fix forgot to specify second param.

This commit is contained in:
David Lebée
2018-03-06 18:34:28 -06:00
parent 667f306598
commit deff96e68c
4 changed files with 80 additions and 2 deletions
+2 -1
View File
@@ -23,7 +23,8 @@ namespace PoweredSoft.DynamicLinq
public enum QueryConvertStrategy
{
LeaveAsIs,
ConvertConstantToComparedPropertyOrField
ConvertConstantToComparedPropertyOrField,
SpecifyType
}
public enum QueryCollectionHandling
@@ -81,7 +81,7 @@ namespace PoweredSoft.DynamicLinq.Helpers
// attempt a conversion.
object convertedValue = TypeHelpers.ConvertFrom(memberType, value);
return Expression.Constant(convertedValue);
return Expression.Constant(convertedValue, memberType);
}
public static ConstantExpression ResolveConstant(Expression member, object value, QueryConvertStrategy convertStrategy)
@@ -89,6 +89,9 @@ namespace PoweredSoft.DynamicLinq.Helpers
if (convertStrategy == QueryConvertStrategy.LeaveAsIs)
return Expression.Constant(value);
if (convertStrategy == QueryConvertStrategy.SpecifyType)
return Expression.Constant(value, member.Type);
if (convertStrategy == QueryConvertStrategy.ConvertConstantToComparedPropertyOrField)
return QueryableHelpers.GetConstantSameAsLeftOperator(member, value);