【问题标题】:Cosmos DB Table API with .NET Core带有 .NET Core 的 Cosmos DB 表 API
【发布时间】:2018-09-18 10:20:03
【问题描述】:

我可以在此处https://docs.microsoft.com/en-us/azure/cosmos-db/tutorial-develop-table-dotnet 看到有关如何将 Cosmos DB 表 API 与 .NET 一起使用的文档。

但我无法在 .NET Core 项目中使用它。有没有办法对 Cosmos DB Table API for .NET Core 进行有效调用?

谢谢

【问题讨论】:

  • 请编辑您的问题并包括:1) 您使用的是哪个 nuget 包? 2) 你遇到了什么错误?
  • 根据我的测试,我们也可以使用WindowsAzure.Storage (9.1.1)来操作Cosmos DB Table API,它可以用于.Net Core。

标签: azure asp.net-core .net-core azure-cosmosdb


【解决方案1】:

目前没有 .NET Core 版本的 Cosmos DB 表 API,但他们正在努力开发。请参阅以下 GitHub 问题:https://github.com/Azure/azure-cosmosdb-dotnet/issues/344

来自one of the comments那里:

我们完全致力于为 Table API 提供 .Net 标准 SDK。我们将在 10 月或之前跟踪交货。

【讨论】:

    【解决方案2】:

    需要在dotnet core项目中添加如下nuget包

    dotnet add package Microsoft.Azure.DocumentDB.Core

    我在Wear out the features of Azure CosmosDB with AspNetCore application写了一篇博客

    编辑

    单击安装以安装 Microsoft.Azure.CosmosDB.Table 库。这将安装 Azure Cosmos DB 表 API 包和所有依赖项。

    【讨论】:

    • 您好,感谢您的回复。对于 Cosmos DB SQL API(文档),它工作得很好,微软也有一个 docs.microsoft.com/en-us/azure/cosmos-db/… 的文档。我要 Cosmos DB 表 API
    • AFAIK,没有用于 cosmos 的表存储功能的 .net 核心 API。您可以使用 DocumentDb.Core 库,但没有任何东西可以让您以与使用表存储相同的方式使用表。这是多么垃圾?!
    • 是否有任何 Cosmos DB 支持 .NET Standard?
    【解决方案3】:

    如果您希望为 Azure Cosmos DB Table API 开发 .NET Standard 应用程序,则应安装 Microsoft.Azure.Cosmos.Table 包

    您可以在此处查看 NuGet 规范:https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Table

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-13
      • 1970-01-01
      • 2023-02-21
      • 2021-12-20
      • 2021-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多