Skip to content

Commit

Permalink
Cosmos: remove automatic composition of discriminator filter in raw S…
Browse files Browse the repository at this point in the history
…QL queries (#26292)

Closes #26124
  • Loading branch information
roji authored Oct 13, 2021
1 parent 6840bb6 commit d5a7cce
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 86 deletions.
3 changes: 1 addition & 2 deletions src/EFCore.Cosmos/Query/Internal/QuerySqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ protected override Expression VisitSelect(SelectExpression selectExpression)
}

Visit(selectExpression.FromExpression);
_sqlBuilder.AppendLine();

if (selectExpression.Predicate != null)
{
_sqlBuilder.Append("WHERE ");
_sqlBuilder.AppendLine().Append("WHERE ");
Visit(selectExpression.Predicate);
}

Expand Down
7 changes: 1 addition & 6 deletions src/EFCore.Cosmos/Query/Internal/SqlExpressionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,7 @@ public virtual SelectExpression Select(IEntityType entityType)
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual SelectExpression Select(IEntityType entityType, string sql, Expression argument)
{
var selectExpression = new SelectExpression(entityType, sql, argument);
AddDiscriminator(selectExpression, entityType);

return selectExpression;
}
=> new(entityType, sql, argument);

private void AddDiscriminator(SelectExpression selectExpression, IEntityType entityType)
{
Expand Down
Loading

0 comments on commit d5a7cce

Please sign in to comment.