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); } }
public UserImage GetByUser(BaseByIdDto dto) { return(ctx.UserImages.Where(p => p.UserId == dto.Id). Include(p => p.Document). OrderByDescending(p => p.CreatedAt).FirstOrDefault()); }
public ActionResult <GetUserIdentityPhotoResultDto> GetUserIdentityPhoto([FromQuery] BaseByIdDto dto) { return(getUserIdentityPhoto.Execute(dto)); }