public IActionResult GetCompanyContacts([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!_companyRepo.CompanyExists(id)) { return(NotFound()); } var contacts = _contactRepo.GetContactsByCompany(id); return(Ok(contacts)); }