@@ -17,6 +17,7 @@ internal class QueryCompiler : IQueryCompiler
1717 private readonly IQueryTranslator _queryTranslator ;
1818 private readonly IQuerySender _requestSender ;
1919 private readonly string ? _discriminator ;
20+
2021 private static readonly MethodInfo RequestSendMethod
2122 = typeof ( IQuerySender ) . GetRuntimeMethods ( )
2223 . Single ( m => ( m . Name == nameof ( IQuerySender . Send ) ) && m . IsGenericMethod ) ;
@@ -29,7 +30,8 @@ private static readonly MethodInfo PostProcessResultAsyncMethod
2930 = typeof ( QueryCompiler ) . GetMethod ( nameof ( PostProcessResultAsync ) ,
3031 BindingFlags . NonPublic | BindingFlags . Static ) ;
3132
32- public QueryCompiler ( IQueryOptimizer queryOptimizer , IQueryTranslator queryTranslator , IQuerySender requestSender , string ? discriminator )
33+ public QueryCompiler ( IQueryOptimizer queryOptimizer , IQueryTranslator queryTranslator ,
34+ IQuerySender requestSender , string ? discriminator )
3335 {
3436 _queryOptimizer = queryOptimizer ;
3537 _queryTranslator = queryTranslator ;
@@ -57,7 +59,8 @@ private TResult SendRequest<TResult>(Expression query, bool async, CancellationT
5759 {
5860 ConstantExpression _ => SendRequestWithoutFilter < TResult > ( query ,
5961 async , cancellationToken ) ,
60- MethodCallExpression methodCallExpression => SendRequestWithFilter < TResult > ( methodCallExpression , query ,
62+ MethodCallExpression methodCallExpression => SendRequestWithFilter < TResult > ( methodCallExpression ,
63+ query ,
6164 async , cancellationToken ) ,
6265 _ => throw new ArgumentException ( $ "Expression of type { query . GetType ( ) . Name } is not valid.")
6366 } ;
@@ -69,7 +72,8 @@ private TResult SendRequest<TResult>(Expression query, bool async, CancellationT
6972 }
7073 }
7174
72- private TResult SendRequestWithoutFilter < TResult > ( Expression query , bool async , CancellationToken cancellationToken )
75+ private TResult SendRequestWithoutFilter < TResult > ( Expression query , bool async ,
76+ CancellationToken cancellationToken )
7377 {
7478 Expression optimizedQuery = _queryOptimizer . Optimize ( query , _discriminator ) ;
7579 var body = _queryTranslator . Translate ( optimizedQuery ) ;
@@ -87,7 +91,7 @@ private TResult SendRequestWithFilter<TResult>(MethodCallExpression methodCallEx
8791 }
8892
8993 var body = _queryTranslator . Translate ( optimizedQuery ) ;
90-
94+
9195 // If no operation must be done on the list return
9296 if ( ! methodCallExpression . Method . IsSupportedByComposition ( ) )
9397 {
@@ -101,12 +105,12 @@ private TResult SendRequestWithFilter<TResult>(MethodCallExpression methodCallEx
101105 // Query database
102106 object couchQueryable = RequestSendMethod
103107 . MakeGenericMethod ( couchListType )
104- . Invoke ( _requestSender , new object [ ] { body , async, cancellationToken } ) ;
108+ . Invoke ( _requestSender , new object [ ] { body , async, cancellationToken } ) ;
105109
106110 // Apply in-memory operations
107111 MethodInfo postProcessResultMethodInfo = ( async
108- ? PostProcessResultAsyncMethod
109- : PostProcessResultMethod )
112+ ? PostProcessResultAsyncMethod
113+ : PostProcessResultMethod )
110114 . MakeGenericMethod ( documentType , returnType ) ;
111115
112116 return ( TResult ) postProcessResultMethodInfo. Invoke ( null ,
@@ -174,7 +178,7 @@ private static TResult PostProcessResult<TSource, TResult>(
174178 // Execute
175179 try
176180 {
177- return ( TResult ) enumerableMethodInfo . Invoke ( null , new [ ] { result } ) ;
181+ return ( TResult ) enumerableMethodInfo . Invoke ( null , new [ ] { result } ) ;
178182 }
179183 catch ( TargetInvocationException ex )
180184 {
@@ -197,4 +201,4 @@ private static async Task<TResult> PostProcessResultAsync<TSource, TResult>(
197201 return PostProcessResult < TSource , TResult > ( couchList , originalMethodCall , optimizedMethodCall ) ;
198202 }
199203 }
200- }
204+ }
0 commit comments