Return json with lower case first letter of property names

前端 未结 4 1938
走了就别回头了
走了就别回头了 2021-02-01 17:43

I have LoginModel:

public class LoginModel : IData
{
    public string Email { get; set; }
    public string Password { get; set; }
}

and I hav

4条回答
  •  春和景丽
    2021-02-01 18:04

    If your are using Newtonsoft.Json, you can add JsonProperties to your view model :

    public class LoginModel : IData
    {
         [JsonProperty(PropertyName = "email")]
         public string Email {get;set;}
    
         [JsonProperty(PropertyName = "password")]
         public string Password {get;set;}
    }
    

提交回复
热议问题