public IActionResult GetContact([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var contact = _contactRepo.GetId(id); if (contact == null) { return(NotFound()); } return(Ok(contact)); }