Skip to content

Commit

Permalink
Merge branch 'rel/1.1.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
anpete committed Nov 29, 2016
2 parents 89d1503 + 43c64d5 commit f153461
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ public virtual void Local_array()
cs.Single(c => c.CustomerID == (string)context.Arguments["customerId"]));
}

[ConditionalFact]
public virtual void Method_with_constant_queryable_arg()
{
using (var context = CreateContext())
{
var count = QueryableArgQuery(context, new [] { "ALFKI" }.AsQueryable()).Count();

Assert.Equal(1, count);

count = QueryableArgQuery(context, new [] { "FOO" }.AsQueryable()).Count();

Assert.Equal(0, count);
}
}

private static IQueryable<Customer> QueryableArgQuery(NorthwindContext context, IQueryable<string> ids)
=> context.Customers.Where(c => ids.Contains(c.CustomerID));

[ConditionalFact]
public void Query_composition_against_ienumerable_set()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ private static bool CompareConstant(ConstantExpression a, ConstantExpression b)
return false;
}

if (a.Value is EnumerableQuery
&& b.Value is EnumerableQuery)
{
return false; // EnumerableQueries are opaque
}

if (a.Value is IQueryable
&& b.Value is IQueryable
&& a.Value.GetType() == b.Value.GetType())
Expand Down

0 comments on commit f153461

Please sign in to comment.