File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Linq . Expressions ;
3
- using System . Reflection ;
4
3
5
4
namespace NHibernate . Impl
6
5
{
7
6
#if NET461
8
7
internal static class LambdaExpressionExtensions
9
8
{
10
- //NET4.6.1 does not have this method exposed,
11
- //however it might be available in runtime
12
- private static readonly MethodInfo CompileWithPreference = typeof ( LambdaExpression )
13
- . GetMethod ( "Compile" , new [ ] { typeof ( bool ) } ) ;
14
-
15
- public static Delegate Compile ( this LambdaExpression expression , bool preferInterpretation )
16
- {
17
- if ( CompileWithPreference != null )
18
- {
19
- return ( Delegate ) CompileWithPreference . Invoke ( expression , new object [ ] { preferInterpretation } ) ;
20
- }
21
-
22
- return expression . Compile ( ) ; //Concurrent Compile() call causes "Garbage Collector" suspend all threads too often
23
- }
9
+ public static Delegate Compile ( this LambdaExpression expression , bool preferInterpretation ) =>
10
+ expression . Compile ( ) ; //Concurrent Compile() call causes "Garbage Collector" suspend all threads too often
24
11
}
25
12
#endif
26
13
}
You can’t perform that action at this time.
0 commit comments