NoFurion 0.0.7
dotnet add package NoFurion --version 0.0.7
NuGet\Install-Package NoFurion -Version 0.0.7
<PackageReference Include="NoFurion" Version="0.0.7" />
<PackageVersion Include="NoFurion" Version="0.0.7" />
<PackageReference Include="NoFurion" />
paket add NoFurion --version 0.0.7
#r "nuget: NoFurion, 0.0.7"
#:package NoFurion@0.0.7
#addin nuget:?package=NoFurion&version=0.0.7
#tool nuget:?package=NoFurion&version=0.0.7
NoFurion
套壳 Abp Vnext 的模块化项目,Furion 封装了太多静态方法,所以放弃兼容,大家直接使用例子迁移至 ABP。
注
框架用的 net8.0 , ABP 8.0.1。
考虑到很多小伙伴用的 SqlSugar,所以 NoFurion 默认做了集成。
熟悉 EF Core 的小伙伴建议直接使用 ABP 。
例子
templates 文件夹中有可运行的例子,直接拉下来,用 Powershell 运行 rename.psl 改名即可。
路由风格
为方便根据 api 定位代码,项目按照模块及方法名来命名路由。
如需运用 RESTful 风格,删除 NoFurion.Mvc.HttpApi 项目中的 BaseConventionalRouteBuilder 文件即可。
实体
1、新建实体,继承 AppFullAuditedEntity;
项目默认使用字符串类型的 Guid 作为主键 Id,大家根据各自使用的 DB 调整 NoFurion 里的 SqlSugarConfig DataType,目前对标的是 PostgreSQL。
EF Core 能通过 Script-Migration 命令生成 DDL 语句,但 SqlSugar 没有类似方法,以下提供两种生成方案。
2.1、SqlSugar方式:在项目 NoFurion.Mvc.HttpApi 中的 CommonAppService InitTables 方法里加入实体;运行接口 /api/app/Common/InitTables,使用 CodeFirst 将实体生成至数据库。
2.2、EFCore方式: 在 MigrationDbContext 中加入对应实体 DataSet,并将项目设为启动项,在程序包管理器控制台中通过 Add-Migration、 Script-Migration、Update-Database 等命令生成至数据库。
枚举
前端调用 /api/app/Common/GetEnumInfo,传入枚举名即可返回枚举内容。
EnumExt.RegisterEnumClass(GetType().Assembly); // 在对应项目 Module 内注册枚举
枚举定义建议使用:中文 = 枚举值。
分页排序查询
分页查询请求类 input 继承 PagedResultInput ,(ISugarQueryable).ToPageListAsync(input) 即可。
自动事务
在方法上打上 [AutoTran] 即可。
如需使用全局事务,新增 AutoTranFilter 继承 IAsyncActionFilter, 逻辑同 AutoTranAttribute, 注册 options.Filters.Add<AutoTranFilter>() 即可。
安装
dotnet add package NoFurion
文档
ABP。
协议
NoFurion 采用 [MIT] 开源协议。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. 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. |
-
net8.0
- Mapster (>= 7.4.1-pre01)
- Serilog.AspNetCore (>= 8.0.1)
- SqlSugarCore (>= 5.1.4.146)
- Volo.Abp.AspNetCore.Mvc (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.