diff --git a/XrmPluginCore.SourceGenerator/Validation/HandlerMethodValidator.cs b/XrmPluginCore.SourceGenerator/Validation/HandlerMethodValidator.cs index 0113aed..2e09d9f 100644 --- a/XrmPluginCore.SourceGenerator/Validation/HandlerMethodValidator.cs +++ b/XrmPluginCore.SourceGenerator/Validation/HandlerMethodValidator.cs @@ -48,18 +48,20 @@ public static void ValidateHandlerMethod( } } - private static IEnumerable GetAllMethodsIncludingInherited(ITypeSymbol type, string methodName) + private static IReadOnlyList GetAllMethodsIncludingInherited(ITypeSymbol type, string methodName) { + var methods = new List(); var currentType = type; while (currentType is not null) { foreach (var member in currentType.GetMembers(methodName)) { if (member is IMethodSymbol method) - yield return method; + methods.Add(method); } currentType = currentType.BaseType; } + return methods; } private static bool SignatureMatches(IMethodSymbol method, bool hasPreImage, bool hasPostImage)