EaCloud.EntityFrameworkCore.Cosmos 9.0.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package EaCloud.EntityFrameworkCore.Cosmos --version 9.0.0.7
                    
NuGet\Install-Package EaCloud.EntityFrameworkCore.Cosmos -Version 9.0.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EaCloud.EntityFrameworkCore.Cosmos" Version="9.0.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EaCloud.EntityFrameworkCore.Cosmos" Version="9.0.0.7" />
                    
Directory.Packages.props
<PackageReference Include="EaCloud.EntityFrameworkCore.Cosmos" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EaCloud.EntityFrameworkCore.Cosmos --version 9.0.0.7
                    
#r "nuget: EaCloud.EntityFrameworkCore.Cosmos, 9.0.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EaCloud.EntityFrameworkCore.Cosmos@9.0.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EaCloud.EntityFrameworkCore.Cosmos&version=9.0.0.7
                    
Install as a Cake Addin
#tool nuget:?package=EaCloud.EntityFrameworkCore.Cosmos&version=9.0.0.7
                    
Install as a Cake Tool

EaCloud Azure Cosmos DB 组件

Member project of EaCloud Team NuGet Badge GitHub license

说明

  1. EaCloud Azure Cosmos DB 组件,封装基于 Microsoft.EntityFrameworkCore.Cosmos 的数据访问功能的实现。
  2. 仅适用于 Azure Cosmos DB 的 SQL API。

用法

可按照如下配置方式使用:

  1. 通过nuget引用 EaCloud.EntityFrameworkCore.Cosmos 程序集
Install-Package EaCloud.EntityFrameworkCore.Cosmos
  1. appsettings.json 中的 EaCloud 节点下添加如下配置节点
{
    //数据库上下文集合
    "DbContexts": {
      //默认数据库上下文
      "DefaultDbContext": {
        "DbContextTypeName": "EaCloud.Entity.DefaultDbContext,EaCloud.EntityFrameworkCore", //上下文类型全名(默认数据库上下文)
        "DatabaseType": "Cosmos", //数据库类型:"Cosmos"(Azure Cosmos DB 的 SQL API)、"Kdbndp"(人大金仓)、"MySql"、"Oracle"、"PostgreSql"、"Sqlite"、"SqlServer"
        "ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;DatabaseName=EaCloud_DEV", //连接字符串(Cosmos)
        //从数据库配置
        "SlaveDatabase": {
          "SlaveSelector": "Weight", //从数据库选择策略:Weight(平滑权重)、Random(随机)、Sequence(顺序轮询)
          //从数据库集合
          "SlaveDatabases": [
            {
              "Name": "Slave01", //数据库名
              "Weight": 2, //权重(1-100)
              "ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;DatabaseName=EaCloud_DEV.Slave01", //连接字符串(Cosmos)
            },
            {
              "Name": "Slave02", //数据库名
              "Weight": 5, //权重(1-100)
              "ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;DatabaseName=EaCloud_DEV.Slave02", //连接字符串(Cosmos)
            }
          ]
        },
        "CommandTimeout": 120, //命令执行超时时长(秒)
        "IsolationLevel": null, //事务隔离级别:"Unspecified"、"Chaos"、"ReadUncommitted"、"ReadCommitted"、"RepeatableRead"、"Serializable"、"Snapshot"
        "Compatibility": false, //启用兼容:开启后将使用旧版行为执行数据库操作已达到可使用较低版本数据库的目的。注:开启后不会使用更高效的SQL生成逻辑,可能会削弱性能。
        "LazyLoadingProxiesEnabled": false, //是否启用延迟加载代理
        "DateTimeUtcFormatEnabled": false, //是否启用时间UTC格式
        "EntityAuditEnabled": true, //是否启用数据审计
        "EntityEventEnabled": true, //是否启用数据事件
        "MigrationAssemblyName": "[Your Migration Assembly Name]", //迁移的程序集名称(为空时默认"DesignTime[Your Name]DbContextFactory"所在程序集),PS:Cosmos暂不支持
        "MigrationEnabled": true //启用自动迁移,PS:Cosmos暂不支持
      }
    },
}

交流

QQ WeChat
QQ群号:863605868 微信号:SeonHu
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EaCloud.EntityFrameworkCore.Cosmos:

Package Downloads
EaCloud.EntityFrameworkCore.Allinone

EaCloud 一体化数据访问组件,封装 Cosmos(Azure Cosmos DB 的 SQL API)、Kdbndp(人大金仓)、MySql、Oracle、PostgreSql、SAP HANA、Sqlite、SqlServer 等类型数据访问功能的实现。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.0.8 83 7/5/2025
9.0.0.7 161 6/25/2025
9.0.0.6 171 6/18/2025
9.0.0.5 172 6/14/2025
9.0.0.4 191 5/8/2025
9.0.0.3 208 4/23/2025
9.0.0.2 191 4/11/2025
9.0.0.1 176 3/21/2025
8.0.1.9 163 11/15/2024
8.0.1.8 159 11/13/2024
8.0.1.7 161 10/9/2024
8.0.1.6 155 9/29/2024
8.0.1.5 168 9/13/2024
8.0.1.4 185 8/10/2024
8.0.1.3 162 8/7/2024
8.0.1.2 165 8/7/2024
8.0.1.1 161 8/7/2024
8.0.0.9 153 8/7/2024
8.0.0.8 135 8/5/2024
8.0.0.7 141 8/2/2024
8.0.0.6 137 8/1/2024
8.0.0.5 137 8/1/2024
8.0.0.4 108 7/31/2024
8.0.0.3 120 7/30/2024
8.0.0.2 147 7/25/2024
8.0.0.1 133 7/24/2024
7.0.9.4 143 7/19/2024
7.0.9.3 145 7/11/2024
7.0.9.2 164 7/6/2024
7.0.9.1 166 7/3/2024
7.0.8.9 167 6/28/2024
7.0.8.8 157 6/26/2024
7.0.8.7 150 6/22/2024
7.0.8.6 160 6/14/2024
7.0.8.5 165 5/31/2024
7.0.8.4 167 5/21/2024
7.0.8.3 136 5/21/2024
7.0.8.2 134 5/20/2024
7.0.8.1 158 5/20/2024
7.0.7.9 166 5/15/2024
7.0.7.8 138 5/10/2024
7.0.7.7 159 5/9/2024
7.0.7.6 157 5/9/2024
7.0.7.5 197 5/7/2024
7.0.7.4 167 4/28/2024
7.0.7.3 165 4/26/2024
7.0.7.2 164 4/21/2024
7.0.7.1 161 4/19/2024
7.0.6.9 156 4/15/2024
7.0.6.8 158 4/11/2024
7.0.6.7 160 4/11/2024
7.0.6.6 155 4/7/2024
7.0.6.5 183 4/7/2024
7.0.6.4 158 4/7/2024
7.0.6.3 156 4/7/2024
7.0.6.2 166 4/3/2024
7.0.6.1 164 4/3/2024
7.0.5.9 151 3/27/2024
7.0.5.8 172 3/23/2024
7.0.5.7 167 3/17/2024
7.0.5.6 171 3/17/2024
7.0.5.5 174 3/16/2024
7.0.5.4 169 3/13/2024
7.0.5.3 190 3/13/2024
7.0.5.2 161 3/6/2024
7.0.5.1 170 2/21/2024
7.0.4.9 162 2/21/2024
7.0.4.8 162 2/18/2024
7.0.4.7 174 2/5/2024
7.0.4.6 168 2/1/2024
7.0.4.5 181 1/26/2024
7.0.4.4 171 1/22/2024
7.0.4.3 163 1/17/2024
7.0.4.2 162 1/16/2024
7.0.4.1 160 1/16/2024
7.0.3.9 146 1/15/2024
7.0.3.8 206 1/3/2024
7.0.3.7 169 12/28/2023
7.0.3.6 168 12/27/2023
7.0.3.5 188 12/22/2023
7.0.3.4 172 12/22/2023
7.0.3.3 197 12/13/2023
7.0.3.2 148 12/13/2023
7.0.3.1 174 12/12/2023
7.0.2.9 178 11/26/2023
7.0.2.8 158 11/26/2023
7.0.2.7 194 9/26/2023
7.0.2.6 178 9/25/2023
7.0.2.5 174 9/15/2023
7.0.2.4 193 7/27/2023
7.0.2.3 226 7/22/2023
7.0.2.2 223 7/22/2023
7.0.2.1 215 7/21/2023
7.0.1.9 215 7/21/2023
7.0.1.8 224 7/20/2023
7.0.1.7 205 7/20/2023
7.0.1.6 236 7/4/2023
7.0.1.5 202 6/16/2023
7.0.1.4 199 6/13/2023
7.0.1.3 197 6/8/2023
7.0.1.2 219 6/2/2023
7.0.1.1 231 5/11/2023
7.0.0.9 223 5/10/2023
7.0.0.8 231 5/10/2023
7.0.0.7 235 4/19/2023
7.0.0.6 256 4/18/2023
7.0.0.5 283 3/27/2023
7.0.0.4 283 3/23/2023
7.0.0.3 372 1/31/2023
7.0.0.2 351 1/30/2023
7.0.0.1 360 12/24/2022
6.0.2.5 482 11/16/2022
6.0.2.4 434 11/10/2022
6.0.2.3 470 10/11/2022
6.0.2.2 528 9/23/2022
6.0.2.1 533 8/14/2022
6.0.1.9 542 8/13/2022
6.0.1.8 587 6/6/2022
6.0.1.7 578 5/26/2022
6.0.1.6 597 5/11/2022
6.0.1.5 574 5/10/2022
6.0.1.4 596 4/8/2022
6.0.1.3 603 4/2/2022
6.0.1.2 595 4/2/2022
6.0.1.1 607 3/18/2022
6.0.0.9 658 3/5/2022
6.0.0.8 647 2/19/2022
6.0.0.7 640 2/15/2022
6.0.0.6 638 2/14/2022
6.0.0.5 688 1/28/2022
6.0.0.4 691 1/13/2022
6.0.0.3 548 1/12/2022
6.0.0.2 548 12/21/2021