I have the following model
public class SocioEconomicStudy : BaseModel
{
public string Folio { get; set; }
public string Craft { get; set; }
public string RequestType {get;set;}
}
And I send the following json
{
"folio" : "folio",
"craft" : "craft,
"request_type": "request_type"
}
But when received the properties with underscore are null, I've tried camel case Pascal case, but only with the lowercase + underscores is that the properties without underscore work.
Controller method:
[HttpPost]
public void Post([FromBody] SocioEconomicStudy study)
{
var cancellationToken = new CancellationToken();
_logger.LogInformation((study != null).ToString());
_context.SocioEconomicStudyRepository.AddAsync(study, cancellationToken);
}
So only the properties without underscore are persisted, any ideas on how to solve this?