Skip to content
bitzorcas
EN

Reference

概述

共享框架库——Domain、Application、Infrastructure、ORM 适配器、Modularity、CodeGeneration、Persistence Models。

Last updated

每个模块组合使用的共享库。稳定、理念明确、为 AI 辅助开发设计,具有严格的质量门禁。

当前已包含

基础框架用途关键类型
DomainDDD 原语、Result 模式、实体接口、多租户、领域事件Result<T>EntityBaseTenantIdIAuditableEntityISoftDelete
ApplicationMediator 管道、授权、租户解析、审计接收器、缓存IAuthorizationDecisionServiceITenantResolverIUnitOfWork、7 个管道行为
InfrastructureORM 无关实现:审计、时钟、缓存、种子、存储AuditLoggerDispatcherFusionCacheAppCacheLocalFileStorageSeedRunner
Infrastructure.SqlSugar主 ORM 适配器——简洁干净、CodeFirst、CSV 种子SqlSugarUnitOfWorkSqlSugarAuditLogStoreCsvSeedStepBase<T>
Infrastructure.EfCore可选 ORM 适配器——IsTrimmable=false、相同契约测试BitzOrcasDbContextEfCorePersistenceSchemaInitializer
Infrastructure.Dapper只读查询适配器——轻量读取路径DapperAuditQueryPort
Infrastructure.Persistence.Models所有 ORM 适配器消费的共享实体模型EntityBaseBizEntityBaseTenantEntityBasePersistenceModelRegistry
Modularity模块治理——声明、依赖图、边界校验IAppModuleAppModuleRegistryAppModuleDependencyGraphAppModuleBoundaryVerifier
CodeGeneration.Abstractions代码生成元数据模型IModuleDefinitionIAggregateDefinitionICodeGenerator
CodeGeneration.Scriban基于 Scriban 的代码生成器,含 13+ 模板聚合、领域事件、命令、处理器、仓储、端点模板

适配器模式

所有基础框架使用四层适配器策略

前缀DI 注册用途
默认InMemory*Null*TryAddSingletonAPI Shell、单元测试
生产SqlSugar*Local*AddScoped(非 TryAdd)主运行时,覆盖默认
可选EfCore*Dapper*AddScoped可切换适配器,相同契约测试
不可用Unavailable*TryAddSingleton快速失败默认

相关