public async Task <IActionResult> Delete(int id)
        {
            var deletedService = await _serviceService.GetByIdAsync(id);

            if (deletedService != null)
            {
                await _serviceService.DeleteAsync(deletedService);
            }
            return(Json(null));
        }
Пример #2
0
        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 }));
        }