Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Version>0.7</Version>
<Authors>Rwing</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/Rwing/EntityFrameworkCore.UseRowNumberForPaging</RepositoryUrl>
Expand All @@ -13,6 +12,18 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<UseEfCore8>false</UseEfCore8>
<UseEfCore9>true</UseEfCore9>
</PropertyGroup>

<PropertyGroup Condition="'$(UseEfCore8)' == 'true'">
<DefineConstants>$(DefineConstants);USE_EF_CORE_8</DefineConstants>
<Version>0.8</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(UseEfCore9)' == 'true'">
<DefineConstants>$(DefineConstants);USE_EF_CORE_9</DefineConstants>
<Version>0.9</Version>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework) != 'net9.0'">
Expand All @@ -23,11 +34,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(UseEfCore8)' == 'true'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<ItemGroup Condition="'$(UseEfCore9)' == 'true'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NET9_0_OR_GREATER
#if USE_EF_CORE_8
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET9_0_OR_GREATER
#if USE_EF_CORE_9
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public virtual QueryTranslationPostprocessor Create(QueryCompilationContext quer
=> new SqlServer2008QueryTranslationPostprocessor(
_dependencies,
_relationalDependencies,
#if NET9_0_OR_GREATER
#if USE_EF_CORE_9
(RelationalQueryCompilationContext)queryCompilationContext
#else
#elif USE_EF_CORE_8
queryCompilationContext
#endif
);
Expand All @@ -28,9 +28,9 @@ public class SqlServer2008QueryTranslationPostprocessor : RelationalQueryTransla
public SqlServer2008QueryTranslationPostprocessor(
QueryTranslationPostprocessorDependencies dependencies,
RelationalQueryTranslationPostprocessorDependencies relationalDependencies,
#if NET9_0_OR_GREATER
#if USE_EF_CORE_9
RelationalQueryCompilationContext queryCompilationContext
#else
#elif USE_EF_CORE_8
QueryCompilationContext queryCompilationContext
#endif
)
Expand All @@ -40,9 +40,9 @@ QueryCompilationContext queryCompilationContext
public override Expression Process(Expression query)
{
query = base.Process(query);
#if NET9_0_OR_GREATER
#if USE_EF_CORE_9
query = new Offset2RowNumberConvertVisitor(query, RelationalDependencies.SqlExpressionFactory, RelationalQueryCompilationContext.SqlAliasManager).Visit(query);
#else
#elif USE_EF_CORE_8
query = new Offset2RowNumberConvertVisitor(query, RelationalDependencies.SqlExpressionFactory).Visit(query);
#endif
return query;
Expand Down