我有一个这个构造函数的类:
- public Currency(Guid? vcurrencyUI = null)
- : base(vcurrencyUI)
- { }
我想使用new()约束这个类,但我得到这个错误:
‘Currency’ must be a non-abstract type with a public parameterless constructor in order to use it as parameter ‘T’ in the generic type or method …
如果我拆分构造函数一切正常:
- public Currency(Guid? vcurrencyUI)
- : base(vcurrencyUI)
- { }
- public Currency()
- : base()
- { }
为什么我需要拆分构造函数?