예제 #1
0
        public PublicProfileDto GetPublicProfile(Guid id)
        {
            var user = _session.Query <User>()
                       .Fetch(x => x.ProfileImages)
                       .Fetch(x => x.Location).Single(x => x.Id == id);
            var profileDto =
                new PublicProfileDto
            {
                FirstName    = user.FirstName,
                LastName     = user.LastName,
                Description  = user.Description,
                Friendship   = user.Friendship,
                Orientation  = user.Orientation,
                Gender       = user.Gender,
                Romance      = user.Romance,
                Age          = user.Age,
                ProfileImage = user.ProfileImageUrl ?? PlaceholderImage
            };

            profileDto.ProfileImageUrls =
                user.ProfileImages.Select(i => new ImageDto
            {
                Url      = i.Url,
                FileName = i.ImageName
            }).ToList();
            return(profileDto);
        }
예제 #2
0
 public PublicProfileDto GetPublicProfile(Guid id)
 {
     var user = _session.Query<User>()
                       .Fetch(x => x.ProfileImages)
                       .Fetch(x => x.Location).Single(x => x.Id == id);
     var profileDto =
         new PublicProfileDto
         {
             FirstName = user.FirstName,
             LastName = user.LastName,
             Description = user.Description,
             Friendship = user.Friendship,
             Orientation = user.Orientation,
             Gender = user.Gender,
             Romance = user.Romance,
             Age = user.Age,
             ProfileImage = user.ProfileImageUrl ?? PlaceholderImage
         };
     profileDto.ProfileImageUrls =
         user.ProfileImages.Select(i => new ImageDto
         {
             Url = i.Url,
             FileName = i.ImageName
         }).ToList();
     return profileDto;
 }