Crping.EFCore
3.43.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Crping.EFCore --version 3.43.0
NuGet\Install-Package Crping.EFCore -Version 3.43.0
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="Crping.EFCore" Version="3.43.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Crping.EFCore --version 3.43.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Crping.EFCore, 3.43.0"
#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.
// Install Crping.EFCore as a Cake Addin #addin nuget:?package=Crping.EFCore&version=3.43.0 // Install Crping.EFCore as a Cake Tool #tool nuget:?package=Crping.EFCore&version=3.43.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Crping.EFCore
基于 EntityFramework Core
的数据库操作工具包基础类,支持读写分离,支持MySQL
、SQL Server
等,包含WebApi
的增、删、改、查、分页等常用方法实现!
版本更新说明
3.43.0
2023-07-27
- 为方法
GetCacheValueAsync
添加默认值
3.42.0
2023-07-24
- 修改
IRelatedBLL
- 修改
Update
相关方法对UpdatedAt
,UpdatedBy
的赋值逻辑
3.41.0
2023-07-04
- 新增
IDomain<TKey>
,BaseDomain<TKey>
3.40.0
2023-06-29
- 为所有泛型参数
TKey
添加约束notnull
- 为用户操作自动绑定用户ID添加
TUserKey
,并添加notnull
约束 - 修改所有接口类因添加
TUserKey
所引发的所有问题 - 修复所有创建功能因接口差异无法自动绑定创建者ID的问题
- 修复所有更新功能因接口差异无法自动绑定创建者ID的问题
- 修复所有删除功能因接口差异无法自动绑定创建者ID的问题
3.39.0
2023-06-11
DAL
新增方法GetKeysetRawListAsync(...)
,及其接口BLL
新增方法GetKeysetRawListAsync(...)
,及其接口BLL
新增方法GetKeysetListAsync(...)
,及其接口WebApiResponse
新增方法PaginationOk(...)
- 新增
Keyset
分页辅助类KeysetQueryOptions
3.38.0
2023-05-25
- 修改领域接口为
IDomain
,并新增委托GetCurrentUserId()
- 修改领域基类为
BaseDomain
,并新增委托GetCurrentUserId()
3.37.0
2023-05-18
- 新增领域接口
IDomain<TUserKey>
- 新增领域基类
BaseDomain<TUserKey>
3.36.1
2023-05-17
- 将方法
FirstAsync(...)
,First(...)
的返回值改为非可空类型
3.36.0
2023-05-17
DAL
新增方法:FirstAsync(...)
,First(...)
BLL
新增方法:FirstAsync(...)
,First(...)
BLL
新增方法:TryCreateAsync(...)
,TryCreate(...)
3.35.0
2023-05-17
- 新增方法
TryCreateAsync(...)
,TryCreate(...)
3.34.0
2023-05-12
- 新增种子数据接口
ISeedData<T>
3.33.0
2023-05-11
QueryOptions
新增属性SelectFunc
,并在所有列表相关方法中添加对其使用
3.32.0
2023-04-26
- 修复方法
GetOrCreateAsync(...)
系列方法内部查询库与创建库不一致的问题 - 新增方法:
GetCascaderAsync(...)
3.31.0
2023-04-23
QueryOptions
新增查询标签属性Tag
- 为所有相关搜索列表方法添加对
TagWith
的调用
3.30.0
2023-04-04
- 启用可空类型
- 修复启用可空类型后产生的所有警告
3.22.0
2023-04-04
DAL
新增方法SetReadDbIfNull()
,属性ReadIfNull
DAL
访问属性Db
时,若为Null
默认初始化为ReadDb
BLL
将默认调用的方法WriteIfNull
改为ReadIfNull
3.21.0
2023-03-28
- 将接口
IConnectionString
,IMyConfiguration
转移到Common
3.20.1
2023-03-13
- 将
GetKvpsAsync
的零值项目名称请选择
改为全部
3.20.0
2023-02-24
DAL
新增LongCountAsync
,LongCount
BLL
新增LongCountAsync
,LongCount
BLL
修改TotalAsync
相关方法,新增最后几天限定统计
3.19.0
2023-02-17
DAL
新增方法SetNoTracking
,SetTrackAll
DAL
将_db
等重要对象私有化DAL
将所有对私有字段的访问改为公共属性,并去除所有多余的判空逻辑DAL
在切换为只读库里自动关闭查询跟踪BLL
新增属性Dal
,用于统一验证BLL
将所有对_dal
字段的引用改为属性Dal
BLL
并去除所有多余的判空逻辑BLL
新增几个未添加的接口BLL
新增接口IKit
,属性Cache
,Logger
3.18.0
2023-02-03
- 将运行时修改为
net7.0
3.17.1
2023-01-13
BLL
修改方法Task<IActionResult> TotalAsync()
中的默认缓存Key
3.17.0
2023-01-13
BLL
新增方法Task<int> TotalAsync(string, TimeSpan?, TimeSpan?)
BLL
新增方法Task<IActionResult> TotalAsync()
3.16.0
2023-01-09
DAL
新增方法(int, TModel) CreateModel(TModel model)
BLL
新增方法(int, TModel) CreateModel(TModel model)
BLL
将3.15
版所有新增方法的返回值改为(int, TModel)
3.15.0
2023-01-09
DAL
新增同步方法FirstOrDefault(condition)
BLL
新增方法GetOrCreate(model)
,GetOrCreateAsync(model)
BLL
新增方法GetOrCreate(model, condition)
,GetOrCreateAsync(model, condition)
3.14.0
2023-01-03
- 更新对
Crping.EFCore.Common
的引用,EFCore相关组件的升级 - 新增全局引用
Global
,并优化所有引用、命名空间、以及部分注释
3.13.0
2022-12-15
- 新增接口
IMyConfiguration
,用于向DbContext
相关类传递配置对象 MyDbContextFactory<TDb>
类添加IConfiguration
属性,并通过方法CreateDbContext
将此属性赋值给DbContext
相关类
3.12.0
2022-12-09
- 添加批量删除方法
ExecuteDelete
,ExecuteDeleteAsync
3.11.0
2022-12-09
- 添加批量更新方法
ExecuteUpdateAsync
,ExecuteUpdate
3.10.1
2022-11-28
- 解决'pagination'添加返回值'orderBy'在不同.net版本中的返回值不同的问题
3.10.0
2022-11-28
- DAL的列表分页返回类型'pagination'添加返回值'orderBy'
3.9.1
2022-11-26
- 解决
pagination
添加返回值Ascending
时queryOptions
为空的Bug
3.9.0
2022-11-23
pagination
添加返回值Ascending
- 升级
EFCore
到7.0.0
3.8.0
2022-09-17
GetValueFromCacheAsync
重命令为GetCacheValueAsync
,并删除参数isRefresh
- 新增重载方法
Task<int> GetCacheValueAsync(string key, Func<Task<int>> getNewValue, TimeSpan? slidingExpiration, TimeSpan? absoluteExpirationRelativeToNow)
3.7.1
2022-09-16
GetPageCountFromCacheAsync
重命名为GetValueFromCacheAsync
- 修改
GetValueFromCacheAsync
的委托参数的返回类型,以支持异步方法
3.7.0
2022-09-16
- 添加内部工具类
Utils
- 添加分页缓存方法:
GetPageCountFromCacheAsync
3.6.0
2022-06-05
- 将所有DAL中业务相关逻辑转移到BLL,并将部分强制更新字段改为可选更新
2022-05-18
- 修改所有InitDb相关方法
- BLL层添加SetReadDb,SetWriteDb方法
2022-04-01
- 更新对Crping.EFCore.Common的引用,并对齐版本号
2021-07-15:
- IWebApiBLL接口与基础实现类添加Read,Write属性,以实现读写分离链接调用
- IBaseDAL接口与与基础实现类添加Read,Write属性,以实现读写分离链接调用
- IBaseDAL接口与与基础实现类添加ReadOnly方法,以实现以参数的方式读写分离链接调用
- IWebApiBLL接口与基础实现类去除所有readOnly参数,改为链式调用
历史记录
- 3.6.0:将所有DAL中业务相关逻辑转移到BLL,并将部分强制更新字段改为可选更新
- 3.5.1:更新引用组件版本
- 3.5.0:修改所有InitDb相关方法,BLL层添加SetReadDb,SetWriteDb方法
- 3.4.0:添加IHostBLL,删除IRelatedBLL,并修改相关方法
- 3.3.0:更新对Crping.EFCore.Common的引用,并对齐版本号
- 3.1.0:给所有方法添加判空逻辑,DbContextFactory类改为MyDbContextFactory
- 3.0.0:目标框架改为.net6.0,并引用EFCore6.0
- 2.4.0:新增方法:ShareCurrentUserIdFunc,重命名方法:ShareDbContext
- 2.3.0:新增方法 GetRawKvpsAsync,并升级EFCore到5.0.10
- 2.2.0:添加带条件的 Include 扩展方法
- 2.1.0:修改默认排序BUG,新增IDisposable, IAsyncDisposable
- 2.0.2:获取列表相关方法添加默认以ID为排序方式的升降序配置
- 2.0.1:CreateDbContext ReadOnly时添加Lock,以防多线程处理时数组越界
- 2.0.0:使用自定义DbContextFactory,延迟创建DbContext等(重大改版!!!)
- 1.5.3:GetKvpsAsync添加参数,修改默认排序
- 1.5.2:修复共享DbContext时的Bug
- 1.5.1:添加DbContext共享
- 1.5.0:重要!!,添加并实现IRelatedBLL接口,拆分DAL,BLL为CRUD等接口
- 1.4.1:去除GetCurrentUserID未赋值时的默认值0,暴露BUG
- 1.4.0:增加并修改DAL、BLL层相关列表方法
- 1.3.1:简化Get类方法重载的参数
- 1.3.0:BLL中的列表方法添加一系列重载
- 1.2.0:修改DAL,BLL的实现基类名称
- 1.1.0:添加Read、Write属性以链式调用方式取代传参方式。
- 1.0.0:包含数据库常规操作的DAL基类,WebApi常规操作的BLL基类等
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Crping.EFCore.Common (>= 3.20.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.EntityFrameworkCore (>= 7.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Crping.EFCore:
Package | Downloads |
---|---|
Crping.EFCore.Controller
基于 Crping.EFCore 的 WebApi 控制器基类 |
|
Crping.Auth.BLL
Crping.Auth 的业务逻辑层 |
|
Crping.Auth.MySql.DAL
Crping.Auth.DAL 的 MySql 实现 |
|
Crping.AuthPolicy.BLL
Package Description |
|
Crping.AuthPolicy.DAL
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
5.0.0 | 74 | 11/17/2024 | |
4.20.0 | 80 | 11/16/2024 | |
4.19.0 | 83 | 11/14/2024 | |
4.18.0 | 81 | 11/14/2024 | |
4.17.0 | 78 | 11/12/2024 | |
4.16.0 | 115 | 10/22/2024 | |
4.15.0 | 116 | 10/19/2024 | |
4.14.0 | 124 | 10/19/2024 | |
4.13.1 | 87 | 10/16/2024 | |
4.13.0 | 87 | 10/12/2024 | |
4.12.0 | 98 | 10/11/2024 | |
4.11.1 | 94 | 10/11/2024 | |
4.11.0 | 82 | 10/11/2024 | |
4.10.0 | 95 | 10/5/2024 | |
4.9.0 | 98 | 9/25/2024 | |
4.8.0 | 101 | 9/20/2024 | |
4.7.0 | 179 | 9/15/2024 | |
4.6.0 | 260 | 4/19/2024 | |
4.5.0 | 154 | 4/9/2024 | |
4.4.0 | 192 | 4/7/2024 | |
4.3.0 | 194 | 3/28/2024 | |
4.2.0 | 213 | 3/15/2024 | |
4.1.0 | 245 | 3/10/2024 | |
4.0.0 | 482 | 1/29/2024 | |
3.44.1 | 726 | 11/13/2023 | |
3.44.0 | 913 | 8/30/2023 | |
3.43.0 | 963 | 7/27/2023 | |
3.42.0 | 987 | 7/24/2023 | |
3.41.0 | 977 | 7/4/2023 | |
3.40.0 | 1,156 | 6/29/2023 | |
3.39.0 | 968 | 6/10/2023 | |
3.38.0 | 1,114 | 5/25/2023 | |
3.37.0 | 1,031 | 5/18/2023 | |
3.36.1 | 1,015 | 5/17/2023 | |
3.36.0 | 948 | 5/17/2023 | |
3.35.0 | 975 | 5/17/2023 | |
3.34.0 | 1,040 | 5/12/2023 | |
3.33.0 | 985 | 5/11/2023 | |
3.32.0 | 952 | 5/10/2023 | |
3.22.0 | 1,023 | 4/4/2023 | |
3.21.0 | 1,061 | 3/28/2023 | |
3.20.1 | 983 | 3/13/2023 | |
3.20.0 | 1,152 | 2/24/2023 | |
3.19.0 | 1,078 | 2/17/2023 | |
3.18.0 | 1,257 | 2/3/2023 | |
3.17.1 | 1,144 | 1/13/2023 | |
3.17.0 | 1,168 | 1/13/2023 | |
3.16.0 | 1,150 | 1/9/2023 | |
3.15.0 | 1,098 | 1/9/2023 | |
3.14.0 | 1,240 | 1/3/2023 | |
3.13.0 | 1,233 | 12/15/2022 | |
3.12.0 | 1,235 | 12/9/2022 | |
3.11.0 | 1,076 | 12/9/2022 | |
3.10.1 | 1,322 | 11/28/2022 | |
3.10.0 | 1,150 | 11/28/2022 | |
3.9.1 | 1,236 | 11/26/2022 | |
3.9.0 | 1,260 | 11/23/2022 | |
3.8.0 | 1,188 | 9/17/2022 | |
3.7.1 | 1,223 | 9/16/2022 | |
3.7.0 | 1,204 | 9/16/2022 | |
3.6.0 | 1,237 | 6/5/2022 | |
3.5.1 | 2,044 | 5/26/2022 | |
3.5.0 | 1,272 | 5/18/2022 | |
3.4.0 | 1,360 | 5/13/2022 | |
3.3.0 | 1,421 | 4/1/2022 | |
3.1.0 | 1,402 | 12/28/2021 | |
3.0.0 | 7,943 | 11/24/2021 | |
2.4.0 | 1,237 | 10/22/2021 | |
2.3.0 | 1,121 | 9/28/2021 | |
2.2.0 | 1,213 | 9/22/2021 | |
2.1.0 | 2,118 | 8/31/2021 | |
2.0.1 | 1,163 | 8/17/2021 | |
2.0.0 | 2,050 | 8/16/2021 | |
1.5.2 | 1,141 | 8/10/2021 | |
1.5.1 | 1,684 | 8/10/2021 | |
1.5.0 | 1,735 | 8/6/2021 | |
1.4.1 | 1,210 | 8/6/2021 | |
1.4.0 | 1,607 | 7/29/2021 | |
1.3.1 | 1,198 | 7/29/2021 | |
1.3.0 | 1,116 | 7/26/2021 | |
1.2.0 | 2,283 | 7/21/2021 | |
1.1.0 | 2,142 | 7/16/2021 | |
1.0.0 | 2,488 | 7/13/2021 |
基于 EF Core 的的数据库操作工具包