示例#1
0
            public async Task <Unit> Handle(Command request, CancellationToken cancellationToken)
            {
                User existingUser = await _userAccessor.GetCurrentUserAsync();

                User modifiedUser = _mapper.Map(request, existingUser);

                IdentityResult result = await _userManager.UpdateAsync(modifiedUser);

                if (result.Succeeded)
                {
                    return(Unit.Value);
                }

                throw new Exception("Problem updating user");
            }