Exemplo n.º 1
0
        public static void SetupRowKeyRecords(ITableStore <TestTableEntity> tableStorage)
        {
            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("John", "Smith")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Jane", "Smith")
                {
                    Age = 28, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Smith")
                {
                    Age = 38, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(entityList).Wait();

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Jones")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(anotherEntityList).Wait();

            var moreEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Bill", "King")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(moreEntityList).Wait();

            var evenMoreEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Bloggs")
                {
                    Age = 32, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(evenMoreEntityList).Wait();
        }
Exemplo n.º 2
0
        public static async Task SetupRecords(ITableStore <TestTableEntity> tableStorage)
        {
            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("John", "Smith")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Jane", "Smith")
                {
                    Age = 28, Email = "*****@*****.**"
                }
            };

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Jones")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            entityList.Combine(anotherEntityList);

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        public static async Task SetupRecordsAgo(ITableStore <TestTableEntity> tableStorage, string ago)
        {
            await tableStorage.DeleteAllAsync();

            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("Kevin", "Bacon")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Steven", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                }
            };

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);

            await Task.Delay(TimeStringParser.GetTimeAgoTimeSpan(ago));

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Liam", "Matthews")
                {
                    Age = 28, Email = "*****@*****.**"
                },
                new TestTableEntity("Mary", "Gates")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            await tableStorage.InsertAsync(anotherEntityList).ConfigureAwait(false);
        }