蛇案例属性的类属性

时间:2021-06-30 12:56:22

标签: c# json json.net

我有一堂课是这样的:

public class CLassTest
{
    [JsonProperty(PropertyName = "id")]
    public int Id { get; set; }
    [JsonProperty(PropertyName = "user_name")]
    public string UserName { get; set; }
    [JsonProperty(PropertyName = "Name ")]
    public string Name { get; set; }
    [JsonProperty(PropertyName = "family_name")]
    public string FamilyName { get; set; }
    
}

问题:我希望所有道具都作为蛇形外壳,所以我为每个道具使用了 JsonProperty 属性。 是否有任何属性可以在整个班级而不是每个道具上使用它?

0 个答案:

没有答案
相关问题