Crping.EFCore.Controller 7.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Crping.EFCore.Controller --version 7.3.0
                    
NuGet\Install-Package Crping.EFCore.Controller -Version 7.3.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.Controller" Version="7.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Crping.EFCore.Controller" Version="7.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Crping.EFCore.Controller" />
                    
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 Crping.EFCore.Controller --version 7.3.0
                    
#r "nuget: Crping.EFCore.Controller, 7.3.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.
#:package Crping.EFCore.Controller@7.3.0
                    
#: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=Crping.EFCore.Controller&version=7.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Crping.EFCore.Controller&version=7.3.0
                    
Install as a Cake Tool

Crping.EFCore.Controller

基于Crping.EFCoreWebApi的增、删、改、查、分页等常用方法实现!

版本更新说明


7.3.0

2026年7月30日 星期三

Crping.EFCore / Crping.EFCore.Common 同步升至 7.3.0

  • 无功能性变更,仅同步版本号(底层 BLL 的时间类型变更对 Controller 层透明)

7.2.0

2026年7月28日 星期一

Crping.EFCore / Crping.EFCore.Common 同步升至 7.2.0

  • 无功能性变更,仅同步版本号

7.1.0

2026年7月28日 星期一

Crping.EFCore 同步升至 7.1.0

新增类(向后兼容 — 旧类标记 [Obsolete]

  • WebApiRootController:控制器根基类,替代 WebApiCoreController("Core" 名称易与 ASP.NET Core 混淆)
  • WebApiIntController:基于 int 类型主键用户的控制器,替代 WebApiForIntController(去掉 "For" 前缀)
  • WebApiLongController:基于 long 类型主键用户的控制器,替代 WebApiForLongController

重命名(向后兼容)

  • WebApiCoreControllerWebApiRootController:旧类保留并继承新类,添加 Dom 属性向后兼容
  • WebApiForIntControllerWebApiIntController:旧类保留并继承新类
  • WebApiForLongControllerWebApiLongController:旧类保留并继承新类

7.0.0

2026年7月26日 星期日

Crping.EFCore 同步升至 7.0.0

清理(破坏性变更 — 文件级)

  • 删除 4 个全注释死代码文件(下游若手动引用以下类型会编译失败):
    • WebApiVersionController.cs(221 行注释,OpenAPI/版本路由相关)
    • SwaggerExt.cs(94 行注释,已被 Crping.ApiDoc.NSwag / Crping.ApiDoc.Scalar 替代)
    • SwaggerOptions.cs(37 行注释)
    • SwaggerFilter.cs(26 行注释)

安全(行为变更 — 建议关注)

  • 移除 MvcControllerWebApiCoreControllerGetCurrentUserId()#if DEBUG 分支
    • 之前:Debug 构建返回硬编码 "DebugUser",Release 构建从 JWT claims 读取
    • 现在:始终从 JWT claims 读取 — 生产环境之前若依赖 Debug 构建的"假用户"行为,需要在配置或开发环境中显式 mock;不再有"Debug 即自动拥有任意身份"的隐式行为
    • 这条与 AGENTS.md「反模式」§#if DEBUG 在生产路径中改变用户身份 一致:本次提交已修复

重构

  • 提取 ExceptionHelperExceptionFilterMapException 逻辑由重复实现改为集中调用,消除 21 行的分散代码

修复

  • Utils.Migrate / Utils.EnsureCreated 改用 GetRequiredService<T>() 解析 DbContext / DbContextFactory,之前若服务未注册会静默吞错(null),现在会立即抛 InvalidOperationException

内部(净状态未变)

  • IDomain 中未使用的 HTTP 类型依赖相关 refactor(commit 3eb4504)已被回退(65ae448),净状态未变

6.10.0

2026年7月14日 星期二
  • 剥离 NSwagApiDocExt(移除 AddAuthOpenApiDocumentUseAuthOpenApi 扩展方法),OpenApi 文档生成由独立包 Crping.ApiDoc.NSwag 提供
  • 移除 NSwag.AspNetCore 包引用;显式声明 Microsoft.AspNetCore.App 共享框架引用以取代原本寄生于 NSwag 的隐式 FrameworkReference
  • 清理不再需要的 Microsoft.AspNetCore.Http.ExtensionsMicrosoft.AspNetCore.Mvc.ViewFeatures 包引用(已被共享框架覆盖)

6.9.0

2026年7月7日 星期二
  • 新增 WebApiCoreController 可直接被需要轻量控制器的场景使用

6.8.0

2026年6月14日 星期日
  • 优化异常处理中间件 ExceptionMiddleware
  • 优化异常过滤器 ExceptionFilter

6.7.0

2026年2月26日 星期三
  • 新增授权验证策略类 AuthPolicies,用于控制器方法的授权验证
  • 为控制器方法添加管理员权限验证:GetDetailsForAdminAsyncGetForAdminEditorAsync 方法添加 [Authorize(AuthPolicies.Admin)] 特性

6.6.0

2026年2月6日 星期五
  • 新增方法ToggleDeleteStatusAsync

6.5.0

2026年2月6日 星期五
  • 优化软删除相关方法逻辑
  • 新增状态切换方法ToggleEnableStatusAsync, ToggleAuditStatusAsync

6.4.0

2025年12月31日 星期三
  • 优化所有命名空间

6.3.0

2025年12月28日 星期日
  • 方法启用控制 MethodsEnable添加更多默认Get方法控制
  • WebApiBaseController新增更多Get方法

6.1.0

2025年12月25日 星期四
  • 将方法禁用控制改为启动控制,默认禁用所有默认方法

6.0.0

2025年11月27日 星期四
  • 升级为 .net10.0

5.1.0

2025年5月23日 星期五
  • 新增方法 SoftDeleteAsync(...)

5.0.0

2024年11月17日 星期日
  • 升级为 .net9.0
  • 更新引用组件,并清理替换弃用的组件

4.11.0

2024年11月16日 星期六
  • 新增类 ExceptionMiddlewareExceptionFilter

4.10.0

2024年11月16日 星期六
  • AuthenticationHeaderValue 修改为 AuthHeaderValue
  • GetAuthenticationHeaderValue() 修改为 GetAuthHeaderValue()
  • 新增类 MethodDisable 以配置默认方法是否可用
  • 为所有默认方法添加是否可用的控制

4.9.0

2024年11月14日 星期四
  • WebApiBaseController 新增方法 GetAuthenticationHeaderValue() 以及属性 AuthenticationHeaderValue

4.8.0

2024年11月14日 星期四
  • WebApiBaseController 新增方法 GetAuthorization() 以及属性 Authorization

4.7.0

2024年10月11日 星期五
  • 优化构造方法 WebApiBaseController,并添加对 SyncConfig() 的调用

4.5.0

2024年7月17日 星期三
  • 新增Migrate()EnsureCreated(...)

4.4.0

2024年4月13日 星期六
  • WebApiBaseController新增TDomain,并修改相关子类

4.3.0

2024年4月7日 星期日
  • 新增领域对象属性DO,并更名_dom__do

4.2.0

2024年4月7日 星期日
  • Controller相关类添加IDomain接口属性_dom_

4.1.0

2024年3月28日 星期四
  • 新增:WebApiBaseControllerWebApiForIntControllerWebApiForLongController

4.0.0

2024年1月27日 星期六
  • 升级目标框架为.net8.0
  • 升级Microsoft.Extensions.Configuration.Abstractions8.0
  • 与系列相关组件对齐版本号

3.19.0

2023-06-29
  • 为所有泛型参数TKey添加约束notnull
  • MvcController的用户权限操作添加泛型TUserKey,并修改相关属性与方法,并重构GetCurrentUserId()
  • WebApiController的用户权限操作添加泛型TUserKey,并修改相关属性与方法,并重构GetCurrentUserId()
  • WebApiVersionController的用户权限操作添加泛型TUserKey,并修改相关属性与方法,并重构GetCurrentUserId()

3.18.0

2023-06-05
  • 新增跨域管理:CrossDomainSetup

3.17.0

2023-05-13
  • 新增方法:UseAuthSwaggerWithVersion()

3.16.0

2023-04-21
  • 方法UseAuthSwagger(...)去除参数,在内部通过DI获取所需数据
  • 优化方法AddAuthSwagger(...)

3.15.0

2023-04-15
  • 项目启动可空类型
  • 新增方法:AddApiVersion
  • 新增属性:BLLLoggerCache,并修改相关方法

3.12.0

2023-03-05
  • 重命名创建与修改相关API默认方法名

3.11.0

2023-02-24
  • GetTotalAsync新增参数lastDays

3.10.0

2023-02-08
  • 新增SwaggerExt类,新增方法AddAuthSwaggerUseAuthSwagger

3.9.0

2023-02-03
  • 将运行时修改为net7.0

3.8.0

2023-01-13
  • WebApiController新增方法Task<IActionResult> GetTotalAsync()
  • WebApiVersionController新增方法Task<IActionResult> GetTotalAsync()

3.7.0

2023-01-03
  • 新增全局引用Global,并优化所有引用
  • 优化所有命名空间,并更新对组件的引用

3.6.1

2022-12-09
  • 删除MvcController中默认的Index方法

3.6.0

2022-12-09
  • 新增MvcController

3.5.0

2022-11-23
  • 升级Swashbuckle.AspNetCore.SwaggerGen6.4.0
  • 更新对Crping.EFCore 3.9.0的引用,使用EFCore 7.0.0

历史版本

  • 3.4.1:更新引用组件版本
  • 3.4.0:适配Crping.EFCore的更新,删除IRelatedBLL相关方法的使用
  • 3.3.0:更新对Crping.EFCore 及 Common的引用,并对齐版本号
  • 3.0.1:给方法添加判空逻辑
  • 3.0.0:目标框架改为.net6.0
  • 2.0.1:升级Swagger相关组件
  • 2.0.0:与 Crping.EFCore 2.0 版本号对齐(EFCore 重大改版!!!)
  • 1.2.1:更新对Crping.EFCore的引用
  • 1.2.0:添加_bll.SetCurrentUserForRelatedBLL(GetCurrentUserId);
  • 1.1.0:升级对Crping.EFCore的引用
  • 1.0.0:支持普通WebApi,带版本控制WebApi
==注意:==
  • Crping.EFCore升级后,此组件需重新打包,保持对Crping.EFCore引用的同步更新,否则会出现“==方法未找到==”的问题
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.4.0 0 8/3/2026
7.3.0 41 7/30/2026
7.2.0 80 7/28/2026
7.1.0 84 7/28/2026
7.0.0 92 7/26/2026
6.10.0 102 7/16/2026
6.9.0 109 7/7/2026
6.8.0 150 6/14/2026
6.7.0 198 2/26/2026
6.6.0 143 2/6/2026
6.5.0 135 2/6/2026
6.4.0 196 12/31/2025
6.3.0 171 12/27/2025
6.1.0 245 12/25/2025
6.0.0 250 11/27/2025
5.1.0 333 5/23/2025
5.0.0 334 11/17/2024
4.11.0 258 11/16/2024
4.10.0 260 11/16/2024
4.9.0 256 11/14/2024
Loading failed

7.3.0 · 2026-07-30
与 Crping.EFCore / Crping.EFCore.Common 同步升至 7.3.0