I have seen several tutorials in which to send a json object with POST method.
[HttpPost]
public async Task<IActionResult> createEntity([FromBody]Entity entity)
{
try
{
await _repository.Entity.CreateEntityAsync(entity);
return Ok();
}
catch (Exception ex)
{
return StatusCode(500, "Internal server error");
}
}
This does the job correctly
Now if I want to send:
{ "ID":1, "data":[ { "value1":"xxxx", "value2":"yyyy" }, { "value1":"zzzz", "value2":"wwww" } ] }
if you could recommend me what would be the best option to work this