Example #1
0
 private InstagramFeed.ImageVote Load(InstagramFeed.Azure.ImageVote vote)
 {
     return(new InstagramFeed.ImageVote
     {
         instagramImageId = vote.instagramImageId,
         voterId = vote.voterId
     });
 }
Example #2
0
        public void Create(InstagramFeed.ImageVote image)
        {
            InstagramFeed.Azure.ImageVote persistedVote = new InstagramFeed.Azure.ImageVote
            {
                instagramImageId = image.instagramImageId,
                RowKey           = Guid.NewGuid().ToString(),
                voterId          = image.voterId
            };

            // Create the CloudTable object that represents the "people" table.
            // Create the table client.
            CloudStorageAccount storageAccount  = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
            CloudTableClient    tableClient     = storageAccount.CreateCloudTableClient();
            CloudTable          table           = tableClient.GetTableReference("ImageVote");
            TableOperation      insertOperation = TableOperation.Insert(persistedVote);

            table.Execute(insertOperation);
        }