public async Task <IActionResult> ApiResourceDelete(ApiResourceDto apiResource) { await _apiResourceService.DeleteApiResourceAsync(apiResource); return(Success(nameof(ApiResources))); }
public async Task <IActionResult> ApiResourceDelete(ApiResourceDto apiResource) { await _apiResourceService.DeleteApiResourceAsync(apiResource); SuccessNotification(_localizer["SuccessDeleteApiResource"], _localizer["SuccessTitle"]); return(RedirectToAction(nameof(ApiResources))); }
public async Task <IActionResult> Delete(int id) { var apiResourceDto = new ApiResourceDto { Id = id }; await _apiResourceService.GetApiResourceAsync(apiResourceDto.Id); await _apiResourceService.DeleteApiResourceAsync(apiResourceDto); return(Ok()); }
public async Task <IActionResult> DeleteApiResourceAsync(int id) { var result = await apiResourceService.DeleteApiResourceAsync(id).ConfigureAwait(false); if (result.Succeeded) { return(Ok()); } ModelState.AddModelError(string.Empty, result.ErrorMessage); return(BadRequest(ModelState)); }
public async Task <IActionResult> Delete(ApiResourceModel model) { if (model.Id == 0) { return(RedirectToAction(nameof(Index))); } var result = await _apiResourceService.DeleteApiResourceAsync(CommonMappers.Mapper.Map <ApiResource>(model)); if (result) { SuccessNotification(await _localizationService.GetResourceAsync("ApiResource.Deleted")); } return(RedirectToAction(nameof(Index))); }