public async Task <IActionResult> Delete(int id) { var deletedService = await _serviceService.GetByIdAsync(id); if (deletedService != null) { await _serviceService.DeleteAsync(deletedService); } return(Json(null)); }
public async Task <IActionResult> DeleteRecord(int id) { var service = await _serviceService.GetAsync(x => x.Id == id); if (service != null) { await _serviceService.DeleteAsync(id); } return(RedirectToAction("Index", "Service", new { id = service?.CarrierId })); }