Skip to content
bitzorcas
中EN

Reference

Template Parameters and Profile Constraints

Public options, defaults, 15 Profiles, internal derivation, output selection, and verification boundaries for bitzorcas-host 1.0.0-alpha1.

Last updated

[!TIP] This page documents the dotnet new bitzorcas-host template-matrix contract. For greenfield projects prefer the bitz scaffolder orthogonal flags; both channels share the same verified consumer baseline.

This page maps to .template.config/template.json in BitzOrcas.Modern.Templates 1.0.0-alpha1. Read Template selection for intent and Create a Consumer Solution for the end-to-end workflow.

Command shape

Terminal window
# Point output at an empty directory and use the lowercase values shown by Help.
dotnet new bitzorcas-host \
--name <SolutionName> \
--output <EmptyDirectory> \
--ProfileChoice <profile> \
--RuntimeAdapter <sqlsugar|efcore>

The template has exactly two business parameters:

ParameterTypeDefaultCurrent contract
--ProfileChoicechoicedefault-business-single15 complete Profiles selecting topology, tenancy, deployment, and one optional extension
--RuntimeAdapterchoicesqlsugarsqlsugar or efcore, selecting the physical ORM provider

Use the lowercase values shown by Help. Omitting both options generates default-business-single + sqlsugar. The Help text is the contract itself — real output below (narrow-terminal wraps collapsed to logical lines):

bitzorcas-host session
$ 
BitzOrcas.Modern Solution Template (C#)
作者: BitzOrcas.Modern
描述: 按 15 个合法 coupled preset 生成可运行 Consumer Solution,显式选择 SqlSugar/EF Core;公开支持 Platform none、Authorization 或 MasterData 单选闭包。
用法:
dotnet new bitzorcas-host [options] [模板选项]
模板选项:
-P, --ProfileChoice <选项> 一次选择业务类型、租户模式、部署方式与行业扩展;所有可选值都是可直接采用的合法组合。
类型: choice
mini-api-single 最小 API、单租户、独立部署、无行业扩展。
default-business-single Business Starter、单租户、独立部署;不附加行业扩展。
default-business-single-authorization Business Starter、单租户、Authorization runtime module。
default-business-single-masterdata Business Starter、单租户、MasterData runtime module。
default-business-single-finance Business Starter、单租户、Finance 扩展。
default-business-single-hr Business Starter、单租户、HR 扩展。
default-business-single-auction Business Starter、单租户、Auction 扩展。
default-business-single-legal Business Starter、单租户、Legal 扩展。
default-business-multi Business Starter、多租户、Aspire 编排;不附加行业扩展。
default-business-multi-authorization Business Starter、多租户、Aspire 编排、Authorization runtime module。
default-business-multi-masterdata Business Starter、多租户、Aspire 编排、MasterData runtime module。
default-business-multi-finance Business Starter、多租户、Aspire 编排、Finance 扩展。
default-business-multi-hr Business Starter、多租户、Aspire 编排、HR 扩展。
default-business-multi-auction Business Starter、多租户、Aspire 编排、Auction 扩展。
default-business-multi-legal Business Starter、多租户、Aspire 编排、Legal 扩展。
默认: default-business-single
-R, --RuntimeAdapter <选项> 物理注册并由生成后行为测试验证的数据库 provider。
类型: choice
sqlsugar 注册生产 SqlSugar adapter。
efcore 注册生产 EF Core adapter。
默认: sqlsugar

Standard dotnet new options

--name (-n), --output (-o), and --force come from the template engine. The template sets preferNameDirectory=true and uses BitzConsumer as its source replacement:

Terminal window
dotnet new bitzorcas-host -n Acme.Cases -o ./Acme.Cases

This renames BitzConsumer.slnx, projects, namespaces, and paths to Acme.Cases. Use an empty output directory. --force may overwrite generated files and is not an upgrade mechanism.

Complete ProfileChoice matrix

ProfileChoiceBaseProfileChoiceTenancyDeploymentPlatformModuleIndustryExtension
mini-api-singlemini-api-singlesinglenonenonenone
default-business-singledefault-business-singlesinglenonenonenone
default-business-single-authorizationdefault-business-singlesinglenoneauthorizationnone
default-business-single-masterdatadefault-business-singlesinglenonemasterdatanone
default-business-single-financedefault-business-singlesinglenonenonefinance
default-business-single-hrdefault-business-singlesinglenonenonehr
default-business-single-auctiondefault-business-singlesinglenonenoneauction
default-business-single-legaldefault-business-singlesinglenonenonelegal
default-business-multidefault-business-multimultiaspirenonenone
default-business-multi-authorizationdefault-business-multimultiaspireauthorizationnone
default-business-multi-masterdatadefault-business-multimultiaspiremasterdatanone
default-business-multi-financedefault-business-multimultiaspirenonefinance
default-business-multi-hrdefault-business-multimultiaspirenonehr
default-business-multi-auctiondefault-business-multimultiaspirenoneauction
default-business-multi-legaldefault-business-multimultiaspirenonelegal

BaseProfileChoice, PlatformModule, and IndustryExtension are internal generated symbols. A caller cannot pass them separately or compose a sixteenth Profile.

RuntimeAdapter

ValueHost registrationTypical persistence packageSchema wiring
sqlsugarAddBitzOrcasSqlSugarBitzOrcas.Framework.Infrastructure.SqlSugarSqlSugar schema operations
efcoreAddBitzOrcasEfCoreEF Core Infrastructure closureIEfCoreSchemaMigrationContribution

Authorization variants use the corresponding provider registration with messaging integration. Behavioral tests inspect the selected ORM; editing the manifest string cannot migrate a project.

Base asset selection

The package maintains three base shapes, with SqlSugar and EF Core directories for each: six native trees in total.

Asset rootSelectionFixed projects
mini-api-single/<orm>Mini Profile + ORMAPI, ServiceDefaults, two test projects
default-business-single/<orm>any Single Business Profile + ORMAPI, ServiceDefaults, Starter Contracts/Application, two test projects
default-business-multi/<orm>any Multi Business Profile + ORMSingle Business projects + AppHost

Extension Profiles reuse the matching base tree. Template conditions retain selected package references, runtime registration, and adoption tests. The Cartesian product of Profiles and ORMs is 30 physical generation paths.

Platform and Industry constraints

PlatformModule

  • authorization: Authorization package, provider, license feature, operations command, and adoption tests; Multi AppHost also orchestrates RabbitMQ and bootstrap.
  • masterdata: MasterData package, provider, license feature, and adoption tests.
  • none: neither Platform runtime is referenced.

IndustryExtension

  • finance, hr, auction, and legal add package closure and module capability to Business Starter;
  • an industry Profile is not a Platform runtime module;
  • some industry packages have transitive dependencies, so inspect final manifest packages;
  • no current Profile combines a Platform suffix with an Industry suffix.

Generated artifact contract

The root always contains:

<Name>.slnx
Directory.Build.props
Directory.Build.targets
Directory.Packages.props
NuGet.Config
README.md
composition-manifest.json
composition-manifest.schema.json
composition-plan.json
src/
tests/

composition-manifest.json currently uses schemaVersion: 2. It records profileChoice, profileId, runtimeAdapter, tenancy, deployment, platformModule, industryExtension, Hosts, projects, packages, capabilities, license features, and verification commands.

composition-plan.json currently uses schemaVersion: 1. It records selectedProjects, selectedEndpoints, selectedJobs, writeFiles, and removePaths. It is an output review artifact, not an editable generation request.

Profile and package closure

Base ProfileProfile packageBusiness source
Mini APIBitzOrcas.Profile.Mini.Apino Starter Module
Default BusinessBitzOrcas.Profile.Default.Businesscustomer-owned Starter Contracts/Application

Framework, Workflow, Licensing, Generator, Platform, and Industry capabilities restore from commercial packages. The template must not copy foundation Framework or Platform source into a Consumer.

Schema command boundary

Business and persistence Profiles expose the schema operations documented by their generated README:

Terminal window
# SqlSugar currently adopts apply.
dotnet run --project src/Hosts/<Name>.Api -- --migrate-schema apply
# EF Core supports modes including plan, status, and apply.
dotnet run --project src/Hosts/<Name>.Api -- --migrate-schema status

Multi AppHost starts a one-shot schema-migrator with --migrate-schema apply and prevents API start through WaitForCompletion if migration fails. Single Profiles have no AppHost; the deployment runbook invokes schema operations explicitly.

Parameter failures

The dotnet new choice validator rejects unknown Profiles and ORMs. Inspect the locally installed version before diagnosing:

Terminal window
dotnet new bitzorcas-host --help
dotnet new uninstall BitzOrcas.Modern.Templates
dotnet new install BitzOrcas.Modern.Templates@1.0.0-alpha1

If Help differs from this page, first check for an old local template or wrong package channel. Do not edit install caches or generated manifests to bypass constraints.

Release verification boundary

The foundation verify-template.sh currently performs:

  • physical generation and structural checks for all 15 Profiles × 2 ORMs;
  • commercial restore, build, test, and API publish for 22 stratified combinations;
  • trimmed publish for 10 representative combinations;
  • Consumer source-boundary, secret, unselected-ORM, architecture, and schema-adoption checks.

These counts describe the template release gate. They do not prove later customer changes remain compliant. Consumer CI continues to run generated Unit and Architecture tests.

See also

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%