azure - 如何通过azure使用现有数据?

标签 azure azure-mobile-services

https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-use-existing-sql-database/

我一直在关注本教程,但它最终创建了一个清空所有数据的新表。如何使其使用现有表中的现有值?

最佳答案

本教程确实使用 Database.SetInitializer(new ExistingInitializer()); 填充示例数据,但它不会创建新的数据库。 确保您具有正确的连接字符串 Name=MS_TableConnectionString(探索现有数据库模型中的步骤 4),以便它指出您现有的数据库

编辑:

首先,注释掉数据库播种器 Database.SetInitializer(new ExistingInitializer()); 并在 MobileCustomerController 中使用 GetAllMobileCustomers 查询现有数据code> 或 MobileOrderController 中的 GetAllMobileOrders 将为您提供 MobileOrderMobileCustomerIQueryable对象,根据需要使用该对象

关于azure - 如何通过azure使用现有数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34405381/

相关文章:

c# - Visual Studio在azure中的wwwroot内部署文件夹在哪里

azure - 从 Azure 网站调用 Google Api 时出现 502 无效响应

使用 RBAC 角色登录 Azure VM 'Virtual Machine User Login'

push-notification - 关闭 android 应用程序时未收到 Azure 推送通知

azure - 获取 Azure 离线同步中某种类型的待处理项目的列表

c# - 如何代表用户调用 Azure DevOps API 方法?

azure - 将 VS2017 Azure DevOps 管道迁移到 VS2019

cordova - Azure 通知中心向 APNS 推送通知有一半时间失败

HTML5 推送通知 - 其他推送方式的示例

c# - Azure 移动应用程序 - 尝试 POST 时收到 405(不允许的方法)