@@ -100,7 +100,8 @@ internal static void SetParameterTypes(
100100 private static IType GetCandidateType (
101101 ISessionFactoryImplementor sessionFactory ,
102102 IEnumerable < ConstantExpression > constantExpressions ,
103- ConstantTypeLocatorVisitor visitor )
103+ ConstantTypeLocatorVisitor visitor ,
104+ System . Type constantType )
104105 {
105106 IType candidateType = null ;
106107 foreach ( var expression in constantExpressions )
@@ -129,28 +130,13 @@ private static IType GetCandidateType(
129130 }
130131 }
131132
132- return candidateType ;
133- }
134-
135- private static IType GetCandidateType (
136- ISessionFactoryImplementor sessionFactory ,
137- HashSet < ConstantExpression > constantExpressions ,
138- ConstantTypeLocatorVisitor visitor ,
139- System . Type constantType )
140- {
141- var candidateType = GetCandidateType ( sessionFactory , constantExpressions , visitor ) ;
142-
143133 if ( candidateType == null )
144- {
145134 return null ;
146- }
147-
135+
148136 // When comparing an integral column with a real parameter, the parameter type must remain real type
149137 // and the column needs to be casted in order to prevent invalid results (e.g. Where(o => o.Integer >= 2.2d)).
150138 if ( constantType . IsRealNumberType ( ) && candidateType . ReturnedClass . IsIntegralNumberType ( ) )
151- {
152139 return null ;
153- }
154140
155141 return candidateType ;
156142 }
@@ -161,7 +147,6 @@ private static IType GetParameterType(
161147 ConstantTypeLocatorVisitor visitor ,
162148 NamedParameter namedParameter )
163149 {
164-
165150 // All constant expressions have the same type/value
166151 var constantExpression = constantExpressions . First ( ) ;
167152 var constantType = constantExpression . Type . UnwrapIfNullable ( ) ;
0 commit comments