Skip to content

Commit

Permalink
Update ReflectionHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
phat committed Oct 23, 2024
1 parent 2d6e54d commit bcdcf8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mix.heart/Helpers/ReflectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ public static Expression<Func<T, bool>> GetExpression<T>(
expression = GetNumericExpression(expressionMethod, fieldPropertyExpression, fieldPropertyType, parsedValue);

}
else if (IsDateTime(parsedValue))
{
expression = GetNumericExpression(expressionMethod, fieldPropertyExpression, fieldPropertyType, parsedValue);
}
else if (parsedValue is string)
{
parsedValue = parsedValue.ToString().Replace("'", "");
Expand Down Expand Up @@ -430,6 +434,11 @@ value is double ||
value is decimal;
}

private static bool IsDateTime(object value)
{
return value is DateTime;
}

private static Expression GetStringContainsExpression(Expression fieldExpression, string propertyName, object propertyValue)
{
var likeMethod = typeof(DbFunctionsExtensions).GetMethod("Like",
Expand Down

0 comments on commit bcdcf8f

Please sign in to comment.