public IActionResult Post([FromBody] Person person) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (person.RegisteredOn == DateTime.MinValue) { person.RegisteredOn = DateTime.Now; } personDAL.AddPerson(person); return(CreatedAtRoute( routeName: "GetPerson", routeValues: new { id = person.Id }, value: person )); }