Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
HuyLuong committed Nov 10, 2020
1 parent 59b8c65 commit 547a7da
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public class InMemoryExpressionTranslatingExpressionVisitor : ExpressionVisitor
private static readonly MethodInfo _likeMethodInfoWithEscape = typeof(DbFunctionsExtensions).GetRuntimeMethod(
nameof(DbFunctionsExtensions.Like), new[] { typeof(DbFunctions), typeof(string), typeof(string), typeof(string) });

private static readonly MethodInfo _randomMethodInfo = typeof(DbFunctionsExtensions).GetRuntimeMethod(
nameof(DbFunctionsExtensions.Random), new[] { typeof(DbFunctions) });

private static readonly MethodInfo _inMemoryLikeMethodInfo =
typeof(InMemoryExpressionTranslatingExpressionVisitor).GetTypeInfo().GetDeclaredMethod(nameof(InMemoryLike));

Expand Down Expand Up @@ -712,6 +715,11 @@ static Expression RemapLambda(GroupingElementExpression groupingElement, LambdaE
return Expression.Call(_inMemoryLikeMethodInfo, visitedArguments);
}

if (methodCallExpression.Method == _randomMethodInfo)
{
return Expression.Constant(new Random().NextDouble());
}

Expression? @object = null;
Expression[] arguments;
var method = methodCallExpression.Method;
Expand Down

0 comments on commit 547a7da

Please sign in to comment.