diff --git a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs index 3a5b3bd9df149..1afaa90c9e532 100644 --- a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs @@ -56,32 +56,40 @@ internal static class ReflectionUtil internal static readonly Type[] EmptyTypes = new Type[0]; /// - /// Creates a delegate which will cast the argument to the appropriate method target type, + /// Creates a delegate which will cast the argument to the type that declares the method, /// call the method on it, then convert the result to object. /// + /// The method to create a delegate for, which must be declared in an IMessage + /// implementation. internal static Func CreateFuncIMessageObject(MethodInfo method) => GetReflectionHelper(method.DeclaringType, method.ReturnType).CreateFuncIMessageObject(method); /// - /// Creates a delegate which will cast the argument to the appropriate method target type, + /// Creates a delegate which will cast the argument to the type that declares the method, /// call the method on it, then convert the result to the specified type. The method is expected /// to actually return an enum (because of where we're calling it - for oneof cases). Sometimes that /// means we need some extra work to perform conversions. /// + /// The method to create a delegate for, which must be declared in an IMessage + /// implementation. internal static Func CreateFuncIMessageInt32(MethodInfo method) => GetReflectionHelper(method.DeclaringType, method.ReturnType).CreateFuncIMessageInt32(method); /// /// Creates a delegate which will execute the given method after casting the first argument to - /// the target type of the method, and the second argument to the first parameter type of the method. + /// the type that declares the method, and the second argument to the first parameter type of the method. /// + /// The method to create a delegate for, which must be declared in an IMessage + /// implementation. internal static Action CreateActionIMessageObject(MethodInfo method) => GetReflectionHelper(method.DeclaringType, method.GetParameters()[0].ParameterType).CreateActionIMessageObject(method); /// /// Creates a delegate which will execute the given method after casting the first argument to - /// the target type of the method. + /// type that declares the method. /// + /// The method to create a delegate for, which must be declared in an IMessage + /// implementation. internal static Action CreateActionIMessage(MethodInfo method) => GetReflectionHelper(method.DeclaringType, typeof(object)).CreateActionIMessage(method); @@ -174,4 +182,4 @@ public enum SampleEnum // Public to make the reflection simpler. public static SampleEnum SampleEnumMethod() => SampleEnum.X; } -} \ No newline at end of file +}