public decimal v1 {
get {
return this._v1;
}
set {
this._v1 = value ?? 0M; // also I tried, default(decimal)
}
}
Error message say :
Operator ‘??’ cannot be applied to operands of type ‘decimal’ and ‘decimal’
Why it does not work, and how should I do make it works?
The
decimaltype cannot be null, so the null-coalesce operator makes no sense here. Just set_v1tovalue.