public IHttpActionResult GetInsurance(int id) { Insurance insurance = _repo.GetInsurance(id); if (insurance == null) { return(NotFound()); } return(Ok(insurance)); }
public async Task <IActionResult> GetInsurance(int id) { // var all = await _repo.GetAllInsurances(); // return Ok(all); var insurance = await _repo.GetInsurance(id); if (insurance != null) { return(Ok(insurance)); } else { return(BadRequest()); } }