Skip to content

Commit

Permalink
InMemory: Preserve type of value buffer expressions when doing Join/S…
Browse files Browse the repository at this point in the history
…electMany

Part of #16963
  • Loading branch information
smitpatel committed Aug 30, 2019
1 parent 83f4cc0 commit 1d89998
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 42 deletions.
15 changes: 9 additions & 6 deletions src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ public virtual void AddInnerJoin(
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(outerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand All @@ -494,8 +495,9 @@ public virtual void AddInnerJoin(
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(innerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand Down Expand Up @@ -683,8 +685,9 @@ public virtual void AddSelectMany(InMemoryQueryExpression innerQueryExpression,
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(outerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public override Task SelectMany_nested_navigation_property_required(bool isAsync
return base.SelectMany_nested_navigation_property_required(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Join_flattening_bug_4539(bool isAsync)
{
return base.Join_flattening_bug_4539(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include18_3_3(bool isAsync)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ public override Task Complex_query_with_optional_navigations_and_client_side_eva
return base.Complex_query_with_optional_navigations_and_client_side_evaluation(isAsync);
}

[ConditionalTheory(Skip = "Issue#16963 Too Many Results")]
public override Task Complex_navigations_with_predicate_projected_into_anonymous_type(bool isAsync)
{
return base.Complex_navigations_with_predicate_projected_into_anonymous_type(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 TooManyResults")]
public override Task SelectMany_with_nested_navigations_and_explicit_DefaultIfEmpty_followed_by_Select_required_navigation_using_different_navs(bool isAsync)
{
Expand Down Expand Up @@ -84,36 +78,12 @@ public override Task Join_with_navigations_in_the_result_selector1(bool isAsync)
return base.Join_with_navigations_in_the_result_selector1(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include10(bool isAsync)
{
return base.Include10(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include11(bool isAsync)
{
return base.Include11(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include18_3_3(bool isAsync)
{
return base.Include18_3_3(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Multiple_include_with_multiple_optional_navigations(bool isAsync)
{
return base.Multiple_include_with_multiple_optional_navigations(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Order_by_key_of_anonymous_type_projected_navigation_doesnt_get_optimized_into_FK_access_subquery(bool isAsync)
{
return base.Order_by_key_of_anonymous_type_projected_navigation_doesnt_get_optimized_into_FK_access_subquery(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Where_nav_prop_reference_optional1_via_DefaultIfEmpty(bool isAsync)
{
Expand Down

0 comments on commit 1d89998

Please sign in to comment.