Esempio n. 1
0
 private static Model.Site.Photo CreatePhoto(PhotoUrlHelper urlHelper, PhotoIndexEntity entity)
 {
     return(new Model.Site.Photo
     {
         Name = urlHelper.Name,
         Extension = urlHelper.Extension,
         Sizes = new[] { new PhotoSize {
                             Container = urlHelper.Container, Nominal = urlHelper.Size, Heigth = entity.Height, Width = entity.Width
                         } }
     });
 }
Esempio n. 2
0
        public void InsertPhotoIndex(string blogname, string id, DateTime date, string sourceBlog, string uri, string name, int size, int width, int heigth, string originalUrl)
        {
            PhotoIndexEntity photoIndexEntity = new PhotoIndexEntity(blogname, id, date, name, size)
            {
                Width  = width,
                Height = heigth,
                Uri    = uri
            };

            TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(photoIndexEntity);

            photoIndexTable.Execute(insertOrMergeOperation);

            PhotoUrlIndexEntity photoUrlIndexEntity = new PhotoUrlIndexEntity
            {
                PartitionKey = string.IsNullOrEmpty(sourceBlog) ? blogname : sourceBlog,
                RowKey       = WebUtility.UrlEncode(originalUrl),
                BlobUrl      = uri
            };

            insertOrMergeOperation = TableOperation.InsertOrMerge(photoUrlIndexEntity);
            photoUrlIndexTable.Execute(insertOrMergeOperation);
        }