@@ -100,7 +100,8 @@ internal static void SetParameterTypes(
100
100
private static IType GetCandidateType (
101
101
ISessionFactoryImplementor sessionFactory ,
102
102
IEnumerable < ConstantExpression > constantExpressions ,
103
- ConstantTypeLocatorVisitor visitor )
103
+ ConstantTypeLocatorVisitor visitor ,
104
+ System . Type constantType )
104
105
{
105
106
IType candidateType = null ;
106
107
foreach ( var expression in constantExpressions )
@@ -129,28 +130,13 @@ private static IType GetCandidateType(
129
130
}
130
131
}
131
132
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
-
143
133
if ( candidateType == null )
144
- {
145
134
return null ;
146
- }
147
-
135
+
148
136
// When comparing an integral column with a real parameter, the parameter type must remain real type
149
137
// and the column needs to be casted in order to prevent invalid results (e.g. Where(o => o.Integer >= 2.2d)).
150
138
if ( constantType . IsRealNumberType ( ) && candidateType . ReturnedClass . IsIntegralNumberType ( ) )
151
- {
152
139
return null ;
153
- }
154
140
155
141
return candidateType ;
156
142
}
@@ -161,7 +147,6 @@ private static IType GetParameterType(
161
147
ConstantTypeLocatorVisitor visitor ,
162
148
NamedParameter namedParameter )
163
149
{
164
-
165
150
// All constant expressions have the same type/value
166
151
var constantExpression = constantExpressions . First ( ) ;
167
152
var constantType = constantExpression . Type . UnwrapIfNullable ( ) ;
0 commit comments