[英]Invalid token 'token' in class, struct, or interface member declaration
I'm trying to create the following Class:我正在尝试创建以下 Class:
public decimal base { get; set; }
and I get the error mentioned.我得到了提到的错误。 Any solution please?
请问有什么解决办法吗? Thank you.
谢谢你。
I'm trying to create the following Class and I get the error mentioned.我正在尝试创建以下 Class,但出现了上述错误。 Any solution please?
请问有什么解决办法吗? Thank you
谢谢
If you want the value to map to it, you need to add the 'JsonProperty' attribute indicating the name of the property.如果你想让它的值为 map,你需要添加 'JsonProperty' 属性来指示属性的名称。
[JsonProperty("base")]
public decimal Base { get; set; }
base
is a special C# keyword. base
是一个特殊的 C# 关键字。
Anyways, public properties should begin with uppercase letter:无论如何,公共属性应该以大写字母开头:
public decimal Base { get; set; }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.