// GET /api/Person
[HttpGet]
public async Task<ActionResult<IEnumerable<PersonDTO>>> GetAllPersons()
{
var persons = await personService.GetAllPersons();
logger.LogInformation("Successfully returned all persons");
return persons;
}
if (id != person.Id)
{
return BadRequest();
}
or
if(ModelState.IsValid)
{
//something there
}
Find more questions by tags ASP.NET