I have the class NameModel
that will be used in the [FromBody]
attribute. I NEED/am required to use Psswd instead of using the word "Password". [JsonProperty]
attribute only works when serialized but it doesn't work if users use "Password" as the parameter inside the Body.
The problem is that I want the parameter being used to still be "Password" when placed in the body. Is this possible?
public class NameModel
{
public string UserName { get; set; }
[JsonProperty(PropertyName = "Password")]
public string Psswd { get; set; }
}
This is inside my ApiController:
public object Login([FromBody]NameModel nameModel) {}