How do C# classes deal with dollar signs in JSON?

前端 未结 3 1787
轻奢々
轻奢々 2020-12-03 17:32

I\'m getting a JSON feed from Google\'s data API and a lot of the property names start with a $ character (dollar sign).

My problem is that I can\'t create a C# clas

3条回答
  •  臣服心动
    2020-12-03 17:38

    You could try using the [JsonProperty] attribute to specify the name:

    [JsonProperty(PropertyName = "$someName")]
    public string SomeName { get; set; }
    

提交回复
热议问题