create a property starting with digit

Viewed 9564

why cant i create a property in class starting with a digit or special character?

P.S. I'm kinda new to c#

public class Test
{
 public int 1property {get;set;}
}
4 Answers

If you're like me, and you were searching for this because you wanted to deserialize JSON from a third-party API that named properties starting with digits:

using Newtonsoft.Json;
public class ThirdPartyAPIResult
{
    [JsonProperty("24h_volume_usd")]
    public double DailyVolumeUSD { get; set; }
}
Related