11using System ;
2+ using System . Collections . Generic ;
23using System . Collections . ObjectModel ;
34using System . Linq . Expressions ;
45using System . Reflection ;
@@ -10,57 +11,59 @@ namespace NHibernate.Linq.Functions
1011{
1112 public class EqualsGenerator : BaseHqlGeneratorForMethod
1213 {
13- public EqualsGenerator ( )
14+ internal static HashSet < MethodInfo > Methods = new HashSet < MethodInfo >
1415 {
15- SupportedMethods = new [ ]
16- {
17- ReflectHelper . FastGetMethod ( string . Equals , default ( string ) , default ( string ) ) ,
18- ReflectHelper . GetMethodDefinition < string > ( x => x . Equals ( x ) ) ,
19- ReflectHelper . GetMethodDefinition < char > ( x => x . Equals ( x ) ) ,
16+ ReflectHelper . FastGetMethod ( string . Equals , default ( string ) , default ( string ) ) ,
17+ ReflectHelper . GetMethodDefinition < string > ( x => x . Equals ( x ) ) ,
18+ ReflectHelper . GetMethodDefinition < char > ( x => x . Equals ( x ) ) ,
19+
20+ ReflectHelper . GetMethodDefinition < sbyte > ( x => x . Equals ( x ) ) ,
21+ ReflectHelper . GetMethodDefinition < byte > ( x => x . Equals ( x ) ) ,
22+
23+ ReflectHelper . GetMethodDefinition < short > ( x => x . Equals ( x ) ) ,
24+ ReflectHelper . GetMethodDefinition < ushort > ( x => x . Equals ( x ) ) ,
2025
21- ReflectHelper . GetMethodDefinition < sbyte > ( x => x . Equals ( x ) ) ,
22- ReflectHelper . GetMethodDefinition < byte > ( x => x . Equals ( x ) ) ,
26+ ReflectHelper . GetMethodDefinition < int > ( x => x . Equals ( x ) ) ,
27+ ReflectHelper . GetMethodDefinition < uint > ( x => x . Equals ( x ) ) ,
2328
24- ReflectHelper . GetMethodDefinition < short > ( x => x . Equals ( x ) ) ,
25- ReflectHelper . GetMethodDefinition < ushort > ( x => x . Equals ( x ) ) ,
29+ ReflectHelper . GetMethodDefinition < long > ( x => x . Equals ( x ) ) ,
30+ ReflectHelper . GetMethodDefinition < ulong > ( x => x . Equals ( x ) ) ,
2631
27- ReflectHelper . GetMethodDefinition < int > ( x => x . Equals ( x ) ) ,
28- ReflectHelper . GetMethodDefinition < uint > ( x => x . Equals ( x ) ) ,
32+ ReflectHelper . GetMethodDefinition < float > ( x => x . Equals ( x ) ) ,
33+ ReflectHelper . GetMethodDefinition < double > ( x => x . Equals ( x ) ) ,
2934
30- ReflectHelper . GetMethodDefinition < long > ( x => x . Equals ( x ) ) ,
31- ReflectHelper . GetMethodDefinition < ulong > ( x => x . Equals ( x ) ) ,
35+ ReflectHelper . FastGetMethod ( decimal . Equals , default ( decimal ) , default ( decimal ) ) ,
36+ ReflectHelper . GetMethodDefinition < decimal > ( x => x . Equals ( x ) ) ,
3237
33- ReflectHelper . GetMethodDefinition < float > ( x => x . Equals ( x ) ) ,
34- ReflectHelper . GetMethodDefinition < double > ( x => x . Equals ( x ) ) ,
35-
36- ReflectHelper . FastGetMethod ( decimal . Equals , default ( decimal ) , default ( decimal ) ) ,
37- ReflectHelper . GetMethodDefinition < decimal > ( x => x . Equals ( x ) ) ,
38+ ReflectHelper . GetMethodDefinition < Guid > ( x => x . Equals ( x ) ) ,
39+ ReflectHelper . GetMethodDefinition < DateTime > ( x => x . Equals ( x ) ) ,
40+ ReflectHelper . GetMethodDefinition < DateTimeOffset > ( x => x . Equals ( x ) ) ,
41+ ReflectHelper . GetMethodDefinition < TimeSpan > ( x => x . Equals ( x ) ) ,
42+ ReflectHelper . GetMethodDefinition < bool > ( x => x . Equals ( default ( bool ) ) ) ,
3843
39- ReflectHelper . GetMethodDefinition < Guid > ( x => x . Equals ( x ) ) ,
40- ReflectHelper . GetMethodDefinition < DateTime > ( x => x . Equals ( x ) ) ,
41- ReflectHelper . GetMethodDefinition < DateTimeOffset > ( x => x . Equals ( x ) ) ,
42- ReflectHelper . GetMethodDefinition < TimeSpan > ( x => x . Equals ( x ) ) ,
43- ReflectHelper . GetMethodDefinition < bool > ( x => x . Equals ( default ( bool ) ) ) ,
44+ ReflectHelper . GetMethodDefinition < IEquatable < string > > ( x => x . Equals ( default ( string ) ) ) ,
45+ ReflectHelper . GetMethodDefinition < IEquatable < char > > ( x => x . Equals ( default ( char ) ) ) ,
46+ ReflectHelper . GetMethodDefinition < IEquatable < sbyte > > ( x => x . Equals ( default ( sbyte ) ) ) ,
47+ ReflectHelper . GetMethodDefinition < IEquatable < byte > > ( x => x . Equals ( default ( byte ) ) ) ,
48+ ReflectHelper . GetMethodDefinition < IEquatable < short > > ( x => x . Equals ( default ( short ) ) ) ,
49+ ReflectHelper . GetMethodDefinition < IEquatable < ushort > > ( x => x . Equals ( default ( ushort ) ) ) ,
50+ ReflectHelper . GetMethodDefinition < IEquatable < int > > ( x => x . Equals ( default ( int ) ) ) ,
51+ ReflectHelper . GetMethodDefinition < IEquatable < uint > > ( x => x . Equals ( default ( uint ) ) ) ,
52+ ReflectHelper . GetMethodDefinition < IEquatable < long > > ( x => x . Equals ( default ( long ) ) ) ,
53+ ReflectHelper . GetMethodDefinition < IEquatable < ulong > > ( x => x . Equals ( default ( ulong ) ) ) ,
54+ ReflectHelper . GetMethodDefinition < IEquatable < float > > ( x => x . Equals ( default ( float ) ) ) ,
55+ ReflectHelper . GetMethodDefinition < IEquatable < double > > ( x => x . Equals ( default ( double ) ) ) ,
56+ ReflectHelper . GetMethodDefinition < IEquatable < decimal > > ( x => x . Equals ( default ( decimal ) ) ) ,
57+ ReflectHelper . GetMethodDefinition < IEquatable < Guid > > ( x => x . Equals ( default ( Guid ) ) ) ,
58+ ReflectHelper . GetMethodDefinition < IEquatable < DateTime > > ( x => x . Equals ( default ( DateTime ) ) ) ,
59+ ReflectHelper . GetMethodDefinition < IEquatable < DateTimeOffset > > ( x => x . Equals ( default ( DateTimeOffset ) ) ) ,
60+ ReflectHelper . GetMethodDefinition < IEquatable < TimeSpan > > ( x => x . Equals ( default ( TimeSpan ) ) ) ,
61+ ReflectHelper . GetMethodDefinition < IEquatable < bool > > ( x => x . Equals ( default ( bool ) ) )
62+ } ;
4463
45- ReflectHelper . GetMethodDefinition < IEquatable < string > > ( x => x . Equals ( default ( string ) ) ) ,
46- ReflectHelper . GetMethodDefinition < IEquatable < char > > ( x => x . Equals ( default ( char ) ) ) ,
47- ReflectHelper . GetMethodDefinition < IEquatable < sbyte > > ( x => x . Equals ( default ( sbyte ) ) ) ,
48- ReflectHelper . GetMethodDefinition < IEquatable < byte > > ( x => x . Equals ( default ( byte ) ) ) ,
49- ReflectHelper . GetMethodDefinition < IEquatable < short > > ( x => x . Equals ( default ( short ) ) ) ,
50- ReflectHelper . GetMethodDefinition < IEquatable < ushort > > ( x => x . Equals ( default ( ushort ) ) ) ,
51- ReflectHelper . GetMethodDefinition < IEquatable < int > > ( x => x . Equals ( default ( int ) ) ) ,
52- ReflectHelper . GetMethodDefinition < IEquatable < uint > > ( x => x . Equals ( default ( uint ) ) ) ,
53- ReflectHelper . GetMethodDefinition < IEquatable < long > > ( x => x . Equals ( default ( long ) ) ) ,
54- ReflectHelper . GetMethodDefinition < IEquatable < ulong > > ( x => x . Equals ( default ( ulong ) ) ) ,
55- ReflectHelper . GetMethodDefinition < IEquatable < float > > ( x => x . Equals ( default ( float ) ) ) ,
56- ReflectHelper . GetMethodDefinition < IEquatable < double > > ( x => x . Equals ( default ( double ) ) ) ,
57- ReflectHelper . GetMethodDefinition < IEquatable < decimal > > ( x => x . Equals ( default ( decimal ) ) ) ,
58- ReflectHelper . GetMethodDefinition < IEquatable < Guid > > ( x => x . Equals ( default ( Guid ) ) ) ,
59- ReflectHelper . GetMethodDefinition < IEquatable < DateTime > > ( x => x . Equals ( default ( DateTime ) ) ) ,
60- ReflectHelper . GetMethodDefinition < IEquatable < DateTimeOffset > > ( x => x . Equals ( default ( DateTimeOffset ) ) ) ,
61- ReflectHelper . GetMethodDefinition < IEquatable < TimeSpan > > ( x => x . Equals ( default ( TimeSpan ) ) ) ,
62- ReflectHelper . GetMethodDefinition < IEquatable < bool > > ( x => x . Equals ( default ( bool ) ) )
63- } ;
64+ public EqualsGenerator ( )
65+ {
66+ SupportedMethods = Methods ;
6467 }
6568
6669 public override bool AllowsNullableReturnType ( MethodInfo method ) => false ;
0 commit comments