I'm trying to POST data to an API which should accept a List<UpdatePointHistory>
. The size of the list is correct but the properties of the objects are blank.
public class UpdatePointHistory
{
string Tree { get; set; }
string FruitCount { get; set; }
string Observations { get; set; }
int PrivateId { get; set; }
}
public void Post([FromBody]List<UpdatePointHistory> updates)
{
//Do some sort of auth for god sake
Console.WriteLine("test");
}
The data I'm posting:
And the object returning from the API:
All your properties are
private
. They need to bepublic
so the model binder knows what to populate and has access to them.