Skip to content

Commit

Permalink
Fix to #15763 - "collection selector was not NavigationExpansionExpre…
Browse files Browse the repository at this point in the history
…ssion" when joining two FromSql()s

Problem was that navigation expansion wasn't recognizing FromSqlOnQueryable as something that needs to be visited, so the expression was not being converted to NavigationExpansionExpression.
SelectMany requires collection navigation to be a NavigationExpansionExpression, hence the error.
  • Loading branch information
maumar committed Jun 5, 2019
1 parent 7f7130a commit df30a90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ protected override Expression VisitMethodCall(MethodCallExpression methodCallExp
return ProcessInclude(methodCallExpression);

//TODO: should we have relational version of this? - probably
case "FromSqlRaw":
return ProcessFromRawSql(methodCallExpression);
case "FromSqlOnQueryable":
return ProcessFromSql(methodCallExpression);

case nameof(EntityFrameworkQueryableExtensions.TagWith):
return ProcessWithTag(methodCallExpression);
Expand Down Expand Up @@ -1172,7 +1172,7 @@ private Expression ProcessCardinalityReducingOperation(MethodCallExpression meth
return new NavigationExpansionExpression(applyOrderingsResult.source, applyOrderingsResult.state, methodCallExpression.Type);
}

private Expression ProcessFromRawSql(MethodCallExpression methodCallExpression)
private Expression ProcessFromSql(MethodCallExpression methodCallExpression)
{
var source = VisitSourceExpression(methodCallExpression.Arguments[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public virtual async Task FromSqlRaw_queryable_composed()
}
}

[Fact(Skip = "#15763")]
[Fact]
public virtual async Task FromSqlRaw_queryable_multiple_composed()
{
using (var context = CreateContext())
Expand All @@ -101,7 +101,7 @@ from o in context.Set<Order>().FromSqlRaw(NormalizeDelimetersInRawString("SELECT
}
}

[Fact(Skip = "Issue#15763")]
[Fact]
public virtual async Task FromSqlRaw_queryable_multiple_composed_with_closure_parameters()
{
var startDate = new DateTime(1997, 1, 1);
Expand All @@ -125,7 +125,7 @@ from o in context.Set<Order>().FromSqlRaw(
}
}

[Fact(Skip = "Issue#15763")]
[Fact]
public virtual async Task FromSqlRaw_queryable_multiple_composed_with_parameters_and_closure_parameters()
{
var city = "London";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ var actual
}
}

[Fact(Skip = "#15763")]
[Fact]
public virtual void FromSqlRaw_queryable_multiple_composed()
{
using (var context = CreateContext())
Expand All @@ -325,7 +325,7 @@ from o in context.Set<Order>().FromSqlRaw(NormalizeDelimetersInRawString("SELECT
}
}

[Fact(Skip = "Issue#15763")]
[Fact]
public virtual void FromSqlRaw_queryable_multiple_composed_with_closure_parameters()
{
var startDate = new DateTime(1997, 1, 1);
Expand All @@ -351,7 +351,7 @@ from o in context.Set<Order>().FromSqlRaw(
}
}

[Fact(Skip = "Issue#15763")]
[Fact]
public virtual void FromSqlRaw_queryable_multiple_composed_with_parameters_and_closure_parameters()
{
var city = "London";
Expand Down Expand Up @@ -503,7 +503,7 @@ public virtual void FromSqlInterpolated_queryable_with_parameters_inline_interpo
}
}

[Fact(Skip = "Issue#15763")]
[Fact]
public virtual void FromSqlInterpolated_queryable_multiple_composed_with_parameters_and_closure_parameters_interpolated()
{
var city = "London";
Expand Down

0 comments on commit df30a90

Please sign in to comment.