I am deserializing a json object from a third party API. One of the Objects properties is a variable called "checked". In c#.net 'checked' is a type. Is there anyway to overcome this.
Im using Newtonsoft Json.net to do the deserializing.
Nothing special about the class,
public class item{
public bool checked;
}
Use the @ to prefix the name:
public class item{
public bool @checked;
}
By the way checked is not a type but a keyword.
From MSDN:
Keywords are predefined, reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers in your program unless they include @ as a prefix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With