Skip to content

Commit c27b8c1

Browse files
committed
Use nameof for method reference.
1 parent 54de1c8 commit c27b8c1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ private Dictionary<MethodInfo, Action<IInvocation>> SetupInvocationMap(Type inte
159159
}
160160

161161
// Methods without parameters
162-
var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic)
163-
?? throw new InvalidOperationException("Unable to locate the MethodWithoutParams method via reflection.");
162+
var methodWithoutParams = GetType().GetMethod(nameof(MethodWithoutParams), BindingFlags.Instance | BindingFlags.NonPublic)
163+
?? throw new InvalidOperationException($"Unable to locate the {nameof(MethodWithoutParams)} method via reflection.");
164164
var methodWithoutParamsDelegate = (Action<IInvocation>)methodWithoutParams.CreateDelegate(typeof(Action<IInvocation>), this);
165165
methodMap.Add(method, methodWithoutParamsDelegate);
166166
}

0 commit comments

Comments
 (0)