예제 #1
0
        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);
        }
예제 #2
0
 public async Task <Profile> ExecuteAsync(UserByIdQuery query)
 {
     return(await _userReader.ByIdAsync(query.Id));
 }