Exemplo n.º 1
0
        public static void Insert(string account, string key, string tableName, string data)
        {
            CloudTableClient tableClient = Client.GetTableClient(account, key);
            CloudTable       table       = tableClient.GetTableReference(tableName);
            TableEntity      entity      = TableEntity.Get(data);
            TableOperation   insert      = TableOperation.Insert(entity);

            table.Execute(insert);
        }
Exemplo n.º 2
0
        public static void Insert(string account, string key, string table, string data)
        {
            CloudTableClient    tableClient = Client.GetTableClient(account, key);
            TableServiceContext context     = tableClient.GetDataServiceContext();

            context.WritingEntity += new EventHandler <ReadingWritingEntityEventArgs>(context_WritingEntity);
            TableEntity entity = TableEntity.Get(data);

            context.AddObject(table, entity);

            context.SaveChangesWithRetries(SaveChangesOptions.ReplaceOnUpdate);
        }
Exemplo n.º 3
0
        public static void Insert(string account, string key, string tableName, string data)
        {
            CloudTableClient tableClient = Client.GetTableClient(account, key);
            CloudTable       table       = tableClient.GetTableReference(tableName);
            TableEntity      entity      = TableEntity.Get(data);
            TableOperation   insert      = TableOperation.Insert(entity);

            table.Execute(insert);

            //TableServiceContext context = tableClient.GetTableServiceContext();
            //context.WritingEntity += new EventHandler<ReadingWritingEntityEventArgs>(context_WritingEntity);

            //context.AddObject(table, entity);

            //context.SaveChangesWithRetries(SaveChangesOptions.ReplaceOnUpdate);
        }