1
我將記錄添加到一個Azure數據使用下面的方法在按鈕click.But我想知道是否有更好的方式來提交數據到數據庫的性能和可擴展性方面沒有爲每個新的項目記錄?如何異步提交多個記錄到數據庫?
這是我當前如何將數據提交到Azure的移動服務:
Item itemOne = new Item { Repititions = " " + fingersSpreadScoreCntr.ToString(), Date = " " + DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"), User = "Ted Bundy" , Exercise = "Fingers Spread"};
await App.MobileService.GetTable<Item>().InsertAsync(itemOne);
Item itemTwo = new Item { Repititions = " " + fistHeldScoreCntr.ToString(), Date = " " + DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"), User = "Joe Bloggs", Exercise = "Fist Held" };
await App.MobileService.GetTable<Item>().InsertAsync(itemTwo);
Item itemThree = new Item { Repititions = " " + waveOutScoreCntr.ToString(), Date = " " + DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"), User = "George Bush", Exercise = "Wrist Extension" };
await App.MobileService.GetTable<Item>().InsertAsync(itemThree);
你是什麼意思「*提交數據到數據庫,而每個新紀錄*創建新項目」,批量插入是什麼意思? – b2zw2a 2014-12-02 21:53:16