From 73b63777ce2a610f5e95bd0f4f8dbeb92a504295 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Thu, 16 Apr 2026 19:06:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(cqrs):=20=E6=B7=BB=E5=8A=A0CQRS=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=99=A8=E6=B3=A8=E5=86=8C=E5=99=A8=E6=BA=90=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现CqrsHandlerRegistryGenerator源代码生成器 - 减少运行时程序集反射扫描开销 - 支持IRequestHandler、INotificationHandler和IStreamRequestHandler接口 - 生成静态注册代码替代运行时动态发现 - 提供精确的运行时类型引用描述功能 - 实现泛型类型和数组类型的反射处理 - 添加日志记录和错误处理机制 - 支持跨程序集类型引用和内部类型反射查找 - 生成符合IServiceCollection的服务注册代码 --- .../Cqrs/CqrsHandlerRegistryGenerator.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GFramework.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs b/GFramework.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs index 49065f0c..3bd3571d 100644 --- a/GFramework.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs +++ b/GFramework.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs @@ -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; } }