【发布时间】:2020-11-06 05:19:37
【问题描述】:
在类中定义了许多属性,但其中一个属性没有被序列化(使用 newtonsoft),下面提到了该属性:
public override string Value
{
set
{
if (value == null)
{
this.Null = true;
}
else if (value == string.Empty)
{
_A = string.Empty;
_P = string.Empty;
_S = string.Empty;
}
else
{
value = _A + _P + _S;
}
}
}
但是当我们在属性中定义 getter 时,它会被序列化,所以请建议;我们不想将 getter 放在属性中。
【问题讨论】:
标签: c# .net asp.net-core .net-core visual-studio-2019