我正在尝试让函数导入正常工作。 EF 调用我的存储过程,但结果有一个我不理解的内部异常:
var result = context.SomeFunctionImport();
我得到:
The 'Cnt' property on 'SomeClass' could not be set to a 'Double' value. You must set this property to a non-null value of type 'Decimal'.
这是 SomeClass
的 Cnt
属性:
[DataMember]
public Nullable<decimal> Cnt
{
get { return _cnt; }
set
{
if (_cnt != value)
{
OnComplexPropertyChanging();
_cnt = value;
OnPropertyChanged("Cnt");
}
}
}
private Nullable<decimal> _cnt;
最佳答案
需要这样定义:public decimal Cnt
关于c# - 如何摆脱 'property could not be set to a double value, you must set this property to a non-null value of type decimal',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6851696/