-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Otherwise MARS is assumed by EF Core, which we don't support. See dotnet/efcore#21420 (cherry picked from commit ab5d62a)
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 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
17 changes: 17 additions & 0 deletions
17
src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContext.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,17 @@ | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Query; | ||
|
||
namespace Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal | ||
{ | ||
public class NpgsqlQueryCompilationContext : RelationalQueryCompilationContext | ||
{ | ||
public NpgsqlQueryCompilationContext( | ||
[NotNull] QueryCompilationContextDependencies dependencies, | ||
[NotNull] RelationalQueryCompilationContextDependencies relationalDependencies, bool async) | ||
: base(dependencies, relationalDependencies, async) | ||
{ | ||
} | ||
|
||
public override bool IsBuffering => base.IsBuffering || IsSplitQuery; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/EFCore.PG/Query/Internal/NpgsqlQueryCompilationContextFactory.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,26 @@ | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Query; | ||
using Npgsql.EntityFrameworkCore.PostgreSQL.Utilities; | ||
|
||
namespace Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal | ||
{ | ||
public class NpgsqlQueryCompilationContextFactory : IQueryCompilationContextFactory | ||
{ | ||
readonly QueryCompilationContextDependencies _dependencies; | ||
readonly RelationalQueryCompilationContextDependencies _relationalDependencies; | ||
|
||
public NpgsqlQueryCompilationContextFactory( | ||
[NotNull] QueryCompilationContextDependencies dependencies, | ||
[NotNull] RelationalQueryCompilationContextDependencies relationalDependencies) | ||
{ | ||
Check.NotNull(dependencies, nameof(dependencies)); | ||
Check.NotNull(relationalDependencies, nameof(relationalDependencies)); | ||
|
||
_dependencies = dependencies; | ||
_relationalDependencies = relationalDependencies; | ||
} | ||
|
||
public virtual QueryCompilationContext Create(bool async) | ||
=> new NpgsqlQueryCompilationContext(_dependencies, _relationalDependencies, async); | ||
} | ||
} |