Is it possible to serialize and deserialize a property name starting with “@”
public string @FirstName { get; set; }
C# compile it but ignore the “@”
Is it possible to serialize and deserialize a property name starting with “@”
public string @FirstName { get; set; }
C# compile it but ignore the “@”
C# doesn’t include the @
when it compiles the property name, i.e. the @
is not apart of the name, it just lets you use c# keywords in variable names.
You can use the Data Contract attributes to provide a different alias during serialization, e.g:
[DataContract]
class Poco
{
[DataMember(Name="@FirstName")]
public string FirstName { get; set; }
}