public MultimediaAsset Adapt(MultimediaInfo info) { if (info == null) { return(new MultimediaAsset()); } return(new MultimediaAsset { Height = info.Height, Width = info.Width, Size = info.Size, Url = _urlSvc.GetImageUrl(info.Path) }); }
public PhotoMultimediaAsset Adapt(MultimediaInfo info, int photoId, string size) { if (info == null) { return(new PhotoMultimediaAsset()); } return(new PhotoMultimediaAsset { Height = info.Height, Width = info.Width, Size = info.Size, Url = _urlSvc.GetImageUrl(info.Path), DownloadUrl = _urlSvc.GetImageDownloadUrl(photoId, size) }); }
#pragma warning restore CA1822 protected MultimediaInfo?BuildMultimediaInfo(dynamic path, dynamic width, dynamic height, dynamic size) { if (path == null) { return(null); } var mi = new MultimediaInfo(); mi.Path = GetValueOrDefault <string>(path); mi.Width = GetValueOrDefault <short>(width); mi.Height = GetValueOrDefault <short>(height); mi.Size = size == null ? 0 : Convert.ToInt64(size); return(mi); }