public async Task <ActionResult> GetNonBills(int id) { try { if (await _repo.GetNonBillById(id) is CoreNonBills bill) { var resource = ApiMapper.MapNonBills(bill); return(Ok(resource)); } } catch (NullReferenceException) { return(NotFound($"No Non-bill with the id of {id}.")); } return(Ok("There are no Non-bills.")); }