From bc8081d0f944b0b27c5df7fe53b24fdbd141728c Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 10 Mar 2021 11:30:23 +0000 Subject: [PATCH] Rename param "type" to "member" --- .../ReflectionExtensions/MemberInfoExtensions.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/X10D/src/ReflectionExtensions/MemberInfoExtensions.cs b/X10D/src/ReflectionExtensions/MemberInfoExtensions.cs index b6c57bd..12123ee 100644 --- a/X10D/src/ReflectionExtensions/MemberInfoExtensions.cs +++ b/X10D/src/ReflectionExtensions/MemberInfoExtensions.cs @@ -67,22 +67,23 @@ namespace X10D.ReflectionExtensions /// /// The attribute type. /// The return type of the delegate. - /// The member. + /// The member. /// A transform function to apply to the attribute. /// /// An instance of as provided from . /// /// - /// is + /// is /// -or- /// is . /// - public static TReturn? SelectFromCustomAttribute(this MemberInfo type, Func selector) + public static TReturn? SelectFromCustomAttribute(this MemberInfo member, + Func selector) where TAttribute : Attribute { - if (type is null) + if (member is null) { - throw new ArgumentNullException(nameof(type)); + throw new ArgumentNullException(nameof(member)); } if (selector is null) @@ -90,7 +91,7 @@ namespace X10D.ReflectionExtensions throw new ArgumentNullException(nameof(selector)); } - return type.GetCustomAttribute() is { } attribute + return member.GetCustomAttribute() is { } attribute ? selector(attribute) : default; }