static async System.Threading.Tasks.Task CreateNewLists(TableStorageListService serviceForUser1, TableStorageListService serviceForUser2, TableStorageListService serviceForUser3) { Console.WriteLine("********* Creating new Lists *********\r\n"); //generate some demo lists var dummyData = new DummyDataGenerator(); var inbox = dummyData.CreateInboxList(); var groceries = dummyData.CreateGroceriesList(); var holiday = dummyData.CreateHolidayList(); //populate the database with the new lists await serviceForUser1.CreateOrUpdateList(inbox); await serviceForUser1.CreateOrUpdateList(groceries); await serviceForUser2.CreateOrUpdateList(holiday); //user 2 await serviceForUser3.CreateOrUpdateList(inbox); // user 3 which is in partition 2 Console.WriteLine("4 Lists created across 3 users in 2 partitions"); }
public async Task <IHttpActionResult> Get() { IEnumerable <List> lists = await this.listService.Get <List>(); foreach (var l in lists) { await this.listService.Delete <List>(l.Id); } var dummyDataGenerator = new DummyDataGenerator(); //ideally this should really be injected via the constructor var inbox = dummyDataGenerator.CreateInboxList(); var groceries = dummyDataGenerator.CreateGroceriesList(); var holiday = dummyDataGenerator.CreateHolidayList(); await this.listService.Create(inbox); await this.listService.Create(groceries); await this.listService.Create(holiday); return(Ok("All existsing lists deleted, and three new lists created")); }