When I post a json to the API the body received is always null. I'm using .net core 2.0
[HttpPost]
public IActionResult UpdateProfile([FromBody] UserProfileView userProfile)
{
return Ok();
}
public class UserProfileView
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("email")]
public string Email { get; set; }
public string UserName { get; set; }
public string DisplayName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Gender { get; set; }
public byte? YearOfBirth { get; set; }
public List<UserAttribute> Attributes { get; set; }
}
Json I'm posting
{
"id": "3e9f50c8-358a-4509-bbe4-4f4c6cc00676",
"email": "joesamraj@outlook.com",
"userName": "619795228409681",
"displayName": "Joe Samraj",
"firstName": "Joe Samraj",
"lastName": "Muthuraj",
"gender": "Male",
"yearOfBirth": "1989",
"attributes": []
}
Header: Content-Type:application/json
what is wrong here?