public async Task <IActionResult> DeleteRecord(int id) { var carrier = _carrierService.GetAll(x => x.Id == id); if (carrier != null) { await _carrierService.DeleteAsync(id); } return(RedirectToAction("Index")); }