Skip to content

Commit 4f051a5

Browse files
committed
Fix S2971: simplify LINQ by moving predicate into FirstOrDefault.
1 parent 9cdab58 commit 4f051a5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public void Intercept(IInvocation invocation)
6666
return method
6767
.DeclaringType?
6868
.GetProperties()
69-
.Where(prop => prop.GetGetMethod() == method)
70-
.FirstOrDefault();
69+
.FirstOrDefault(prop => prop.GetGetMethod() == method);
7170
}
7271

7372
private static void InvalidReturnTypeInvocation(IInvocation invocation)

0 commit comments

Comments
 (0)