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));
        }
Ejemplo n.º 2
0
 public async Task <AjaxResult> AddOrUpdateApiResourceAsync([FromBody] ApiResourceInputDto dto)
 {
     return((await _apiResourceService.CreateOrUpdateApiResourceAsync(dto)).ToAjaxResult());
 }