Skip to content

Commit

Permalink
Query: Mark entity shaper nullable only when correct (#22533)
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel authored Oct 8, 2020
1 parent 2403579 commit e3a059b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1641,9 +1641,10 @@ static void ValidateIdentifyingProjection(SelectExpression selectExpression)
if (!innerSelectProjectionExpressions.Contains(innerSelectIdentifier.Column)
&& (selectExpression.GroupBy.Count == 0
|| !selectExpression.GroupBy.Contains(innerSelectIdentifier.Column)))

{
throw new InvalidOperationException(RelationalStrings.MissingIdentifyingProjectionInDistinctGroupBySubquery(
innerSelectIdentifier.Column.Table.Alias + "." + innerSelectIdentifier.Column.Name));
}
}
}
}
Expand Down Expand Up @@ -2046,7 +2047,10 @@ private Expression AddJoin(
}
}

innerShaper = new EntityShaperNullableMarkingExpressionVisitor().Visit(innerShaper);
if (innerNullable)
{
innerShaper = new EntityShaperNullableMarkingExpressionVisitor().Visit(innerShaper);
}

return New(
transparentIdentifierType.GetTypeInfo().DeclaredConstructors.Single(),
Expand Down

0 comments on commit e3a059b

Please sign in to comment.