-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query: Copy order by from subquery on need basis only
- We dont need to copy always now since new IncludeCompiler lifts order by at query model level - Move RowNumberPagingExpressionVisitor to SqlServerQuerySqlGenerator - Introduce ISqlServerOptions, SqlServerOptions to flow SqlServerDbOptionsExtension to SqlServerQuerySqlGenerator as singleton service to get value of RowNumberPaging - Remove SqlServerQueryModelVisitor - Add explicit tests for #6736
- Loading branch information
Showing
15 changed files
with
429 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/EFCore.SqlServer/Infrastructure/Internal/ISqlServerOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Infrastructure.Internal | ||
{ | ||
/// <summary> | ||
/// Options set at the <see cref="IServiceProvider" /> singleton level to control SqlServer specific options. | ||
/// </summary> | ||
public interface ISqlServerOptions : ISingletonOptions | ||
{ | ||
/// <summary> | ||
/// Reflects the option set by <see cref="SqlServerDbContextOptionsBuilder.UseRowNumberForPaging" />. | ||
/// </summary> | ||
bool RowNumberPagingEnabled { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Infrastructure.Internal; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Internal | ||
{ | ||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public class SqlServerOptions : ISqlServerOptions | ||
{ | ||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public virtual void Initialize(IDbContextOptions options) | ||
{ | ||
var sqlServerOptions = options.FindExtension<SqlServerOptionsExtension>() ?? new SqlServerOptionsExtension(); | ||
|
||
RowNumberPagingEnabled = sqlServerOptions.RowNumberPaging ?? false; | ||
} | ||
|
||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public virtual void Validate(IDbContextOptions options) | ||
{ | ||
var sqlServerOptions = options.FindExtension<SqlServerOptionsExtension>() ?? new SqlServerOptionsExtension(); | ||
|
||
if (RowNumberPagingEnabled != (sqlServerOptions.RowNumberPaging ?? false)) | ||
{ | ||
throw new InvalidOperationException( | ||
CoreStrings.SingletonOptionChanged( | ||
nameof(SqlServerDbContextOptionsBuilder.UseRowNumberForPaging), | ||
nameof(DbContextOptionsBuilder.UseInternalServiceProvider))); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public virtual bool RowNumberPagingEnabled { get; private set; } | ||
} | ||
} |
165 changes: 0 additions & 165 deletions
165
src/EFCore.SqlServer/Query/Internal/SqlServerQueryModelVisitor.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.