FactoryCenter 1.1.0

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

FactoryCenter

配置驱动 + 动态路由的通用工厂编排引擎(.NET 8.0 类库)。

特性

  • 配置驱动:业务(BizList)经路由(BizToFactory)编排多个工厂(FactoryList),由数据库配置驱动,无硬编码。
  • 动态路由:FactoryRegistry 按 FactoryCode 在运行时解析 IFactory 实现,业务工厂由引入方注册。
  • 顺序编排:FactoryOrchestrator 按 ExecuteOrder 执行工厂链,失败按 IsContinue 决定继续或中断。
  • 上下文共享:FactoryContext.ContextData 在工厂链中传递,上游输出经出参映射(FactoryOutputParam)后供下游工厂消费。
  • 可观测:每次调用经 FactoryInvokeLog 落库。

快速接入

// 1. 在宿主 DbContext.OnModelCreating 中注册工厂表
protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);
    builder.ConfigureFactoryCenter();
}

// 2. 注册服务与业务工厂
services.AddFactoryCenter<YourDbContext>();
services.AddScoped<IFactory, YourFactoryA>();

// 3. 调用
var results = await factoryCenterService.ExecuteAsync(bizCode, userInputs, currentUserID, hospitalID, ct);

数据表(Code First)

BizList / FactoryList / FactoryInputParam / BizToFactory / FactoryOutputParam / FactoryInvokeLog,通过 ConfigureFactoryCenter 落到引入方数据库。

详见项目内 FactoryCenter项目说明文档.md。

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
1.1.0 34 10/3/2026
1.0.0 106 9/1/2026