【发布时间】:2015-12-24 09:03:57
【问题描述】:
我一直在关注本教程,但它最终创建了一个清空所有数据的新表。如何让它使用现有表中的现有值?
【问题讨论】:
标签: azure azure-mobile-services
我一直在关注本教程,但它最终创建了一个清空所有数据的新表。如何让它使用现有表中的现有值?
【问题讨论】:
标签: azure azure-mobile-services
本教程确实使用Database.SetInitializer(new ExistingInitializer()); 填充示例数据,但它不会创建新数据库。
确保您有正确的连接字符串 Name=MS_TableConnectionString(探索现有数据库模型中的第 4 步),以便它指出您现有的数据库
编辑:
首先,注释掉数据库播种器Database.SetInitializer(new ExistingInitializer()); 并查询您现有的数据使用MobileCustomerController 中的GetAllMobileCustomers 或MobileOrderController 中的GetAllMobileOrders 它会给你IQueryable 的MobileCustomer 的@987654330 @object,随意使用那个对象
【讨论】: