Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit b10360c

Browse files
authored
add EF 9.rc2 support (#401)
1 parent c0fb721 commit b10360c

8 files changed

+43
-28
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3-
<Version>8.1.0</Version>
3+
<Version>9.0.0</Version>
44

55
<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
66
<Product>Linq to DB</Product>

Directory.Packages.props

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
4-
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
5-
<PackageVersion Include="NUnit" Version="4.1.0" />
6-
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
3+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
4+
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
5+
<PackageVersion Include="NUnit" Version="4.2.2" />
6+
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
77

8-
<PackageVersion Include="linq2db" Version="5.4.0" />
9-
<PackageVersion Include="linq2db.Tools" Version="5.4.0" />
8+
<PackageVersion Include="linq2db" Version="5.4.1" />
9+
<PackageVersion Include="linq2db.Tools" Version="5.4.1" />
1010

11-
<PackageVersion Include="NUnit.Analyzers" Version="4.0.1" />
12-
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.145" />
11+
<PackageVersion Include="NUnit.Analyzers" Version="4.3.0" />
12+
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.173" />
1313

1414
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1515

16-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
17-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
16+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0-rc.2.24474.1" />
17+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0-rc.2.24474.1" />
1818

19-
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
19+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0-rc.2.24473.5" />
2020

21-
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.1" />
22-
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="8.0.2" />
23-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
24-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
21+
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.1" />
22+
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="9.0.0-rc.2" />
23+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0-rc.2.24474.1" />
24+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-rc.2.24474.1" />
2525

2626
<PackageVersion Include="EntityFrameworkCore.FSharp" Version="6.0.7" />
2727
</ItemGroup>

NuGet/linq2db.EntityFrameworkCore.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<license type="file">MIT-LICENSE.txt</license>
1616
<dependencies>
1717
<group targetFramework="net8.0">
18-
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="8.0.0" />
19-
<dependency id="linq2db" version="5.4.0" />
18+
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="9.0.0-rc.2.24474.1" />
19+
<dependency id="linq2db" version="5.4.1" />
2020
</group>
2121
</dependencies>
2222
</metadata>

Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ public ValueConverter(
473473

474474
sealed class SqlTransparentExpression : SqlExpression
475475
{
476+
//private static readonly ConstructorInfo _ctor = typeof(SqlTransparentExpression).GetConstructor([typeof(ExceptExpression), typeof(RelationalTypeMapping)])
477+
// ?? throw new InvalidOperationException();
478+
476479
public Expression Expression { get; }
477480

478481
public SqlTransparentExpression(Expression expression, RelationalTypeMapping? typeMapping) : base(expression.Type, typeMapping)
@@ -485,6 +488,22 @@ protected override void Print(ExpressionPrinter expressionPrinter)
485488
expressionPrinter.PrintExpression(Expression);
486489
}
487490

491+
public override Expression Quote()
492+
{
493+
// don't implement till first request or when we figure out how to quote Expression
494+
throw new NotImplementedException("Quote is not implemented yet");
495+
496+
//#pragma warning disable EF9100 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
497+
// return New(
498+
// _ctor,
499+
// // TODO: implement quoting
500+
// // we pass only ConstantExpression here and
501+
// // FromSqlExpression has example of ConstantExpression quotation
502+
// Expression,
503+
// RelationalExpressionQuotingUtilities.QuoteTypeMapping(TypeMapping));
504+
//#pragma warning restore EF9100 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
505+
}
506+
488507
private bool Equals(SqlTransparentExpression other)
489508
{
490509
return ReferenceEquals(this, other);

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsDataConnection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
99
using Microsoft.EntityFrameworkCore.Infrastructure;
1010
using Microsoft.EntityFrameworkCore.Metadata;
11-
using Microsoft.EntityFrameworkCore.Storage;
1211
using Microsoft.Extensions.Caching.Memory;
1312

1413
namespace LinqToDB.EntityFrameworkCore
@@ -177,7 +176,7 @@ object IEntityServiceInterceptor.EntityCreated(EntityCreatedEventData eventData,
177176
if (!valid)
178177
return entity;
179178

180-
entry = retrieved ?? _stateManager.StartTrackingFromQuery(_lastEntityType, entity, ValueBuffer.Empty);
179+
entry = retrieved ?? _stateManager.StartTrackingFromQuery(_lastEntityType, entity, Snapshot.Empty);
181180

182181
return entry.Entity;
183182
}

Tests/.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
[*.cs]
2+
dotnet_diagnostic.NUnit4001.severity = none

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
variables:
22
solution: 'linq2db.EFCore.sln'
33
build_configuration: 'Release'
4-
assemblyVersion: 8.1.0
5-
nugetVersion: 8.1.0
4+
assemblyVersion: 9.0.0
5+
nugetVersion: 9.0.0-rc.2
66
artifact_nugets: 'nugets'
77

88
# build on commits to important branches (master + release branches):
@@ -34,10 +34,10 @@ stages:
3434

3535

3636
- task: UseDotNet@2
37-
displayName: 'Install .NET 8'
37+
displayName: 'Install .NET 9'
3838
inputs:
3939
includePreviewVersions: true
40-
version: 8.x
40+
version: 9.x
4141

4242
- task: PowerShell@2
4343
inputs:

linq2db.EFCore.sln

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ Global
7171
{F65A1BBB-46F4-48A4-9778-1A5396A876AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
7272
{F65A1BBB-46F4-48A4-9778-1A5396A876AE}.Release|Any CPU.Build.0 = Release|Any CPU
7373
{0F013A9A-AC97-4A5E-A5D7-E1B64541CC46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74-
{0F013A9A-AC97-4A5E-A5D7-E1B64541CC46}.Debug|Any CPU.Build.0 = Debug|Any CPU
7574
{0F013A9A-AC97-4A5E-A5D7-E1B64541CC46}.Release|Any CPU.ActiveCfg = Release|Any CPU
76-
{0F013A9A-AC97-4A5E-A5D7-E1B64541CC46}.Release|Any CPU.Build.0 = Release|Any CPU
7775
{615C5697-5FA7-490C-8812-3D61994A8AC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7876
{615C5697-5FA7-490C-8812-3D61994A8AC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
7977
{615C5697-5FA7-490C-8812-3D61994A8AC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
8078
{615C5697-5FA7-490C-8812-3D61994A8AC1}.Release|Any CPU.Build.0 = Release|Any CPU
8179
{ECF4637B-1C93-4D87-BDF2-E7F4DF7ED5C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
82-
{ECF4637B-1C93-4D87-BDF2-E7F4DF7ED5C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
8380
{ECF4637B-1C93-4D87-BDF2-E7F4DF7ED5C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
84-
{ECF4637B-1C93-4D87-BDF2-E7F4DF7ED5C9}.Release|Any CPU.Build.0 = Release|Any CPU
8581
EndGlobalSection
8682
GlobalSection(SolutionProperties) = preSolution
8783
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)