azure - 我应该使用什么 Azure 移动服务 - TableController 或 API Controller ?

标签 azure azure-mobile-services azure-table-storage

我正在使用 Azure 移动应用服务开发一个新应用程序,并使用 .NET 开发后端,并选择 Azure 表作为后端存储。到目前为止,我发现的所有示例都使用 TableController 作为任何 API Controller 的基础,并且模型必须从 EntityData 派生。此实体数据不包含分区和行键,但我们需要这些键用于 Azure 表存储。 访问表存储的其他方式是通过 Microsoft.WindowsAzure.Storage,并且模型将从 TableEntity 继承。

请建议使用azure移动应用程序开发后端服务的适当方法是什么。

最佳答案

我们可以通过新的 Microsoft.Azure.Mobile.Server.Storage 包使用 Azure 表存储作为 TableController 的后备数据提供程序。详细信息见Azure Mobile Apps September 2015 Update 。详细步骤见this article 。您需要多注意以下几点:
1) 与Azure SQL数据库不同,Azure表存储是一种非关系型存储。
2)从StorageData而不是EntityData派生的数据类型,StorageData中的Id必须格式为“,

    public class TodoItem : StorageData
    {
        public TodoItem(): base("partition", System.Guid.NewGuid().ToString())
        {

        }
        public string Text { get; set; }

        public bool Complete { get; set; }

    }


3) 与 SQL 数据库不同,表存储作为后端数据不会返回 IQueryable。

关于azure - 我应该使用什么 Azure 移动服务 - TableController 或 API Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39315750/

相关文章:

azure - 尝试使用 Azure AD 登录时出现错误 AADSTS65001

c# - 从 Windows Azure 存储检索图像 (Base64String)

azure - 查询 Azure 表存储中的空值

Azure 存储表大小

sql-server - SQL 数据库从 Azure VM 转换到 Azure SQL 数据库 - 新数据库的大小明显更小?

azure - 新的 Azure IaaS 云上的 AWS Route53 和弹性负载均衡器等效项

.net - 在 Azure DevOps 中获取 UseDotNet@2 以使用 vmImage 的 dotnet SDK(或来自缓存的 SDK)

android - 如何支持与 Azure 移动服务 Android 的一对多关系

c# - 无法将 azure 表存储中字符串类型的实体更新为 null

amazon-web-services - AWS KMS 与其他云服务的互操作性