Beispiel #1
0
        public Photo AsPhoto()
        {
            Photo        photo        = Photo.New();
            PhotoService photoService = new PhotoService();

            //创建
            if (PhotoId == 0)
            {
                Album album = photoService.GetAlbum(this.AlbumId);
                photo.AlbumId       = this.AlbumId;
                photo.TenantTypeId  = album.TenantTypeId;
                photo.OwnerId       = album.OwnerId;
                photo.UserId        = album.UserId;
                photo.Author        = photo.User != null ? photo.User.DisplayName : album.Author;
                photo.OriginalUrl   = string.Empty;
                photo.RelativePath  = string.Empty;
                photo.AuditStatus   = AuditStatus.Pending;
                photo.PrivacyStatus = album.PrivacyStatus;
                photo.IsEssential   = false;
            }
            else
            {
                photo = photoService.GetPhoto(this.PhotoId);
            }
            photo.Description = Formatter.FormatMultiLinePlainTextForStorage(this.Description, false) ?? string.Empty;
            return(photo);
        }