feat(cqrs): 添加CQRS处理器注册器源代码生成器

- 实现CqrsHandlerRegistryGenerator源代码生成器
- 减少运行时程序集反射扫描开销
- 支持IRequestHandler、INotificationHandler和IStreamRequestHandler接口
- 生成静态注册代码替代运行时动态发现
- 提供精确的运行时类型引用描述功能
- 实现泛型类型和数组类型的反射处理
- 添加日志记录和错误处理机制
- 支持跨程序集类型引用和内部类型反射查找
- 生成符合IServiceCollection的服务注册代码
This commit is contained in:
GeWuYou 2026-04-16 19:06:11 +08:00
parent eca2d67529
commit 73b63777ce

View File

@ -409,6 +409,8 @@ public sealed class CqrsHandlerRegistryGenerator : IIncrementalGenerator
case ITypeParameterSymbol:
return false;
default:
// Treat other Roslyn type kinds, such as dynamic or unresolved error types, as referenceable for now.
// If a real-world case proves unsafe, tighten this branch instead of broadening the named-type path above.
return true;
}
}