コード例 #1
0
ファイル: GetUserIdentityPhoto.cs プロジェクト: hiwamn/Mukta
        public GetUserIdentityPhotoResultDto Execute(BaseByIdDto dto)
        {
            GetUserIdentityPhotoResultDto result = new GetUserIdentityPhotoResultDto {
                Status = true
            };
            UserImage image = unit.UserImages.GetByUser(dto);

            if (image != null)
            {
                result.Object = new IdentityImage {
                    Location = image.Document.Location, ImageId = image.Id
                }
            }
            ;
            return(result);
        }
    }
コード例 #2
0
 public UserImage GetByUser(BaseByIdDto dto)
 {
     return(ctx.UserImages.Where(p => p.UserId == dto.Id).
            Include(p => p.Document).
            OrderByDescending(p => p.CreatedAt).FirstOrDefault());
 }
コード例 #3
0
 public ActionResult <GetUserIdentityPhotoResultDto> GetUserIdentityPhoto([FromQuery] BaseByIdDto dto)
 {
     return(getUserIdentityPhoto.Execute(dto));
 }