public IActionResult Insert([FromBody] User value) { if (value is null) { return(BadRequest("value is null.")); } if (!ModelState.IsValid) { return(BadRequest()); } UserContract.Add(value); return(CreatedAtRoute("GetUser", new { controller = "User", id = value.Id }, value)); }