Zeek.Plus.Templates 10.0.3

Zeek.Plus.Templates

Zeek.Plus.Templates 是 PlusFramework 的 dotnet new 模板包。

它只负责生成推荐项目骨架,不是运行时模块,不参与 PlusApplication 依赖图。

安装

dotnet new install Zeek.Plus.Templates --nuget-source https://baget.pluscode.cn/v3/index.json

本地验证 .nupkg 时可以使用:

dotnet new uninstall Zeek.Plus.Templates
dotnet new install .\.artifacts\templates-plus\Zeek.Plus.Templates.10.0.3.nupkg --force

模板

dotnet new plus -n Commerce

plus 生成一个可 restore/build/test 的干净模块化单体解决方案,默认包含 HttpApi.HostDbMigratorCatalog、测试项目、NuGet.configREADME.md.http 文件。

新增业务模块时,可以复制生成项目中的 Catalog 模块后按业务名称自行改名,再显式接入 Host、DbMigrator 和 solution。

参数

日常使用只需要:

dotnet new plus -n Commerce --database PostgreSql
dotnet new plus -n Commerce --database Sqlite
dotnet new plus -n Commerce --database PostgreSql --aspire true

完整参数如下:

  1. -n:项目名,参与 solution、Host、DbMigrator、测试项目和默认应用壳 namespace。
  2. --database:支持 PostgreSqlSqlServerMySqlSqlite,默认 PostgreSql
  3. --aspire:是否生成 AppHostServiceDefaults,默认 false
  4. --root-namespace:生成 Host、DbMigrator 和测试代码的根 namespace,默认使用项目名;业务模块保持自身 namespace。
  5. --framework-version:生成项目引用的 Zeek.Plus.* 包版本,默认 10.0.1

约束

生成项目默认引用 Zeek.Plus.* NuGet 包,不引用当前仓库 PlusFramework/src

模板业务代码直接使用 Facet source generator 演示 DTO 映射,不生成 Zeek.Plus.Mapping 模块,也不依赖运行时 IObjectMapper

生成项目默认不包含全局 using 文件,并设置 ImplicitUsings=disable;模板源码文件显式声明自身 using

--database MySql 会在 HttpApi.HostDbMigratorappsettings.json 中输出默认 EntityFrameworkCore:MySql:ServerVersion,避免启动期自动探测数据库版本。

--aspire true 只影响生成项目的开发期编排输出,不会让 PlusFramework 运行时模块依赖 Aspire。

模板不会生成真实密码、API key、token、前端、Administration、PermissionManagement、Identity 平台、网关、认证中心、Redis、工作流或 MongoDB。

.NET 10.0

  • No dependencies.

Version Downloads Last updated
10.0.10 2 06/05/2026
10.0.9 2 06/05/2026
10.0.8 2 06/05/2026
10.0.7 3 06/05/2026
10.0.6 3 06/05/2026
10.0.5 3 06/05/2026
10.0.4 2 06/05/2026
10.0.3 3 06/05/2026
10.0.2 2 06/05/2026
10.0.1 3 06/05/2026