WWB.NET.Framework 1.0.0

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

WWB.NET.Framework

WWB.NET.Framework 是一个基于 .NET 10 的可复用 ASP.NET Core 后端基础设施框架,提供缓存与 Redis、SqlSugar 持久化、JWT、雪花 Id、Quartz 调度、统一 Web 能力、领域事件、仓储、工作单元和 AOP 等通用能力。

安装

<PackageReference Include="WWB.NET.Framework" Version="1.0.0" />

最小装配

在宿主项目的 Program.cs 中显式注册框架和业务模块:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNetModule<DemoModuleMarker>();
builder.Services.AddNetFramework(builder.Configuration);

var app = builder.Build();
app.UseNetFramework();
app.MapControllers();
app.Run();

业务模块应使用程序集 Marker 注册模块程序集;框架不会隐式扫描宿主进程中的所有项目程序集。Controller 是否暴露由模块自己的 AddNet...Controllers() 扩展按需控制。

配置

生产环境请通过配置中心或环境变量提供数据库、Redis、JWT 和跨域配置。不要将连接字符串、签名密钥或其他敏感信息提交到源码仓库。

框架支持 PostgreSQL、MySQL、SQL Server 和 SQLite。数据库初始化、迁移和种子数据应由业务模块的 Infrastructure 层负责。

设计约束

  • 业务模块按 DomainApplicationInfrastructure 分层。
  • Domain 不依赖 Web 或 Infrastructure 实现细节。
  • 所有模块程序集由宿主显式注册,支持按需装配。
  • 写操作使用 [UnitOfWork] 管理事务;分布式锁使用 [RedisLock]
  • Redis 不可用时,依赖 Redis 的能力会快速失败并返回明确异常。

文档与示例

仓库地址:https://github.com/wwb/WWB.NET.Framework

示例宿主和 Demo 模块位于 backend/src/WWB.NET.Simple.Hostbackend/src/WWB.NET.Simple.Demo

许可证

本项目采用 MIT License,详见包内 LICENSE 文件。

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
1.0.0 92 8/17/2026