I have a LoginModel:
public class LoginModel : IData { public string Email { get; set; } public string Password { get; set; } }
and I have a web api method
public IHttpActionResult Login([FromBody] LoginModel model) { return this.Ok(model); }
And it returns 200 and body:
{ Email: "dfdf", Password: "dsfsdf" }
But I want to get the bottom first letter in a type property
{ Email: "dfdf", Password: "dsfsdf" }
And I have a Json contract resolver to fix
public class FirstLowerContractResolver : DefaultContractResolver { protected override string ResolvePropertyName(string propertyName) { if (string.IsNullOrWhiteSpace(propertyName)) return string.Empty; return $"{char.ToLower(propertyName[0])}{propertyName.Substring(1)}"; } }
How can i apply this?
source share