public async Task <IActionResult> CreateOrUpdateApiResourceAsync(ApiResourceDto dto) { var result = await apiResourceService.CreateOrUpdateApiResourceAsync(dto).ConfigureAwait(false); if (result.Succeeded) { return(Ok()); } ModelState.AddModelError(string.Empty, result.ErrorMessage); return(BadRequest(ModelState)); }
public async Task <AjaxResult> AddOrUpdateApiResourceAsync([FromBody] ApiResourceInputDto dto) { return((await _apiResourceService.CreateOrUpdateApiResourceAsync(dto)).ToAjaxResult()); }