NoFurion 0.0.7

dotnet add package NoFurion --version 0.0.7
                    
NuGet\Install-Package NoFurion -Version 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="NoFurion" Version="0.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NoFurion" Version="0.0.7" />
                    
Directory.Packages.props
<PackageReference Include="NoFurion" />
                    
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 NoFurion --version 0.0.7
                    
#r "nuget: NoFurion, 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 NoFurion@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=NoFurion&version=0.0.7
                    
Install as a Cake Addin
#tool nuget:?package=NoFurion&version=0.0.7
                    
Install as a Cake Tool

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 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. 
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
0.0.7 266 3/20/2024
0.0.6 281 1/4/2024
0.0.5 215 1/4/2024
0.0.4 225 12/26/2023
0.0.3 218 12/20/2023
0.0.2 173 12/8/2023
0.0.1 152 12/5/2023