public DomainPhotos Convert(PhotoCollection photoCollection)
        {
            if (photoCollection == null)
                return null;

                var domainPhotos = photoCollection
                .Select(photo => Mapper.Map<DomainPhoto>(photo))
                .ToList();

            return new DomainPhotos(domainPhotos, photoCollection.Page, photoCollection.Pages);
        }
Example #2
0
        public DomainPhotos Convert(PhotoCollection photoCollection)
        {
            if (photoCollection == null)
                return null;

            var domainPhotos = photoCollection
                .Select(photo => new DomainPhoto(
                                     photo.PhotoId, photo.UserId, photo.OwnerName, string.IsNullOrEmpty(photo.PathAlias) ? photo.UserId : photo.PathAlias,
                                     photo.Title, photo.WebUrl,
                                     photo.SmallUrl,
                                     photo.SmallWidth ?? 240, photo.SmallHeight ?? 240,
                                     IsLicensed(photo)))
                .ToList();
            return new DomainPhotos(domainPhotos, photoCollection.Page, photoCollection.Pages);
        }