Пример #1
0
 protected void AddTestRecord(string partitionKey, string rowKey, string name, int age)
 {
     var mark = new SimpleTest {PartitionKey = partitionKey, RowKey = rowKey, Name = name, Age = age};
     var context = _tableClient.GetDataServiceContext();
     context.AddObject("SimpleTest", mark);
     context.SaveChanges();
 }
Пример #2
0
        public void InsertWorksWithAnObject()
        {
            var bob = new SimpleTest
                          {
                              PartitionKey = "1235",
                              RowKey = string.Empty,
                              Name = "Bob",
                              Age = 42
                          };

            var actual = Db.SimpleTest.Insert(bob);

            Assert.NotNull(actual);
            Assert.Equal(bob.PartitionKey, actual.PartitionKey);
            Assert.Equal(bob.RowKey, actual.RowKey);
            Assert.Equal(bob.Name, actual.Name);
            Assert.Equal(bob.Age, actual.Age);
        }