I am trying to bind data in my model posted from postman in my below model:
public class VariantModel
{
public int Id { get; set; }
public List<SubvariantModel> Subvariants { get; set; }
}
public class SubvariantModel
{
public int Id { get; set; }
public string Description { get; set; }
public IFormFile Document { get; set; }
}
Every property is getting populated but only Document property is coming null as you can see here :
But surprisingly when i inspect http request object i see that file :
This is how i am posting data from POSTMAN :

Code :
[HttpPost]
public void Post([FromForm]VariantModel emp)
{
var d = HttpContext.Request;
}
Can anybody tell me what could be the issue here?
Update :




Subvariants[0].Document, notSubvariants[0][Document]. It's surprising that this actually works forIdandDescription, but perhaps it simply doesn't for some reason withIFormFile. Seems odd, but I honestly don't see anything else wrong.ASP.NET Core 2.0and everything worked fine for me. Could you please share your project on github and share the requests you performed via postman?