public async Task <Profile> ExecuteAsync(UserProfileQuery query) { Guid userId = _principalProvider.Get().GetUserId(); User result = await _userReader.ByIdAsync(userId); var profile = new Profile { Id = result.Id, FirstName = result.FirstName, LastName = result.LastName, Email = result.Email, Nickname = result.Nickname, IsAdmin = result.Roles?.Contains(UserRoles.Administrator) ?? false }; return(profile); }
public async Task <Profile> ExecuteAsync(UserByIdQuery query) { return(await _userReader.ByIdAsync(query.Id)); }