public async Task <IActionResult> Delete([Required] string id) { var result = await _services.DeleteAsync(id); if (result.IsValid) { await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Delete, Tables.Hobby); } return(Ok(result)); }
public async Task <IActionResult> DeleteConfirmed(string id) { if (id == null) { return(NotFound()); } var result = await _services.DeleteAsync(id); return(result.IsValid ? RedirectToAction("Index") : _oops.OutPutError("Hobby", "Index", result.ErrorsList)); }
public async Task <IActionResult> DeleteConfirmed([Required] string id) { var result = await _services.DeleteAsync(id); if (result.IsValid) { await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Delete, Tables.Hobby); return(RedirectToAction("Index")); } TempData["ErrorsList"] = result.ErrorsList; return(View()); }