public async Task <Unit> Handle(UpdateRoleCommand request, CancellationToken cancellationToken)
            {
                ApplicationRole roleToUpdate = await _roleStorage.FindByIdAsync(request.RoleId)
                                               .ConfigureAwait(false)
                                               ?? throw new NotFoundException(nameof(ApplicationRole), request.RoleId);

                UpdateApplicationRoleProperties(roleToUpdate, request);

                IIdentityResult identityResult = await _roleStorage.UpdateAsync(roleToUpdate)
                                                 .ConfigureAwait(false);

                identityResult.ThrowIfFailed();

                return(Unit.Value);
            }
Example #2
0
        public async Task AuthenticateIdentity(IIdentity identity)
        {
            var newIdentity = await _identityFactory.AuthenticateIdentityAsync(identity);

            await _identityStorage.UpdateAsync(newIdentity);
        }