Ejemplo n.º 1
0
        public async Task <IActionResult> IdentityResourceDelete(IdentityResourceDto identityResource)
        {
            await _identityResourceService.DeleteIdentityResourceAsync(identityResource);


            return(Success(nameof(IdentityResources)));
        }
        public async Task <IActionResult> IdentityResourceDelete(IdentityResourceDto identityResource)
        {
            await _identityResourceService.DeleteIdentityResourceAsync(identityResource);

            SuccessNotification(_localizer["SuccessDeleteIdentityResource"], _localizer["SuccessTitle"]);

            return(RedirectToAction(nameof(IdentityResources)));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> RemoveIdentityResource([FromBody] int Id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelStateErrors));
            }
            var result = await _identityResourceService.DeleteIdentityResourceAsync(Id);

            return(ResultResponse(result, "移除身份资源成功"));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Delete(int id)
        {
            var identityResource = new IdentityResourceDto {
                Id = id
            };

            await _identityResourceService.GetIdentityResourceAsync(identityResource.Id);

            await _identityResourceService.DeleteIdentityResourceAsync(identityResource);

            return(Ok());
        }
        public async Task <IActionResult> DeleteIdentityResourceAsync(int id)
        {
            var result = await identityResourceService.DeleteIdentityResourceAsync(id).ConfigureAwait(false);

            if (result.Succeeded)
            {
                return(Ok());
            }

            ModelState.AddModelError(string.Empty, result.ErrorMessage);
            return(BadRequest(ModelState));
        }
        public async Task <IActionResult> Delete(IdentityResourceModel model)
        {
            if (model.Id == 0)
            {
                return(RedirectToAction(nameof(Index)));
            }

            var result = await _identityResourceService.DeleteIdentityResourceAsync(CommonMappers.Mapper.Map <IdentityResource>(model));

            if (result)
            {
                SuccessNotification(await _localizationService.GetResourceAsync("IdentityResource.Deleted"));
                return(RedirectToAction(nameof(Index)));
            }

            return(View(model));
        }