【发布时间】:2015-01-31 02:36:53
【问题描述】:
我在单击按钮时使用以下方法将记录添加到 Azure 数据。但我想知道在性能和可伸缩性方面是否有更好的方法将数据提交到数据库,而无需为每个数据创建新项目新纪录?
这是我目前向 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);
【问题讨论】:
-
什么是“*提交数据到数据库而不为每个新记录创建新项目*”,批量插入?
标签: c# performance azure scalability record