Пример #1
0
 public ActionResult CreateMassive(string partKey)
 {
     for (int i = 0; i < 100; i++)
     {
         var analysis = new Analysis()
         {
             Created = DateTime.UtcNow,
             Title = "Some title - " + i.ToString(),
             Description = "Some description - " + i.ToString()
         };
         SaveAnalysis(analysis, partKey);
     }
     return View();
 }
Пример #2
0
        private static void SaveAnalysis(Analysis analysis, string partKey = PartitionKey)
        {
            var rowkey = ShortGuid.NewGuid().Value;
            var cloudObject = new CloudEntity<Analysis>
            {
                PartitionKey = partKey,
                RowKey = rowkey,
                Value = analysis
            };

            var entities = new CloudTable<Analysis>(Providers.TableStorage, TableName);
            entities.Insert(cloudObject);
        }