public async Task <IActionResult> DeleteApiResourceAsync(string subject) { var meta = await GetCoreMetaDataAsync(); if (!meta.SupportsDelete) { return(MethodNotAllowed()); } if (string.IsNullOrWhiteSpace(subject)) { ModelState["subject.String"].Errors.Clear(); ModelState.AddModelError("", Messages.SubjectRequired); } if (!ModelState.IsValid) { return(BadRequest(ModelState.ToError())); } var result = await _service.DeleteAsync(subject); if (result.IsSuccess) { return(NoContent()); } return(BadRequest(result.ToError())); }
public async Task <AjaxResult> DeleteAsync(Guid id) { return((await _apiResourceService.DeleteAsync(id)).ToAjaxResult()); }
public async Task <ActionResult> RemoveApiResourceAsync(int id) { await apiResourceService.DeleteAsync(id); return(Ok()); }