Skip to content

Commit 3949e67

Browse files
authored
Add support for .NET 8 + Microsoft.EntityFrameworkCore 8 (#756)
* Add .NET 8 * fix ci * readme
1 parent ea4efac commit 3949e67

File tree

12 files changed

+168
-14
lines changed

12 files changed

+168
-14
lines changed

.github/workflows/ci.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414

15-
- uses: actions/setup-dotnet@v1
15+
- uses: actions/setup-dotnet@v3
1616
with:
17-
dotnet-version: '6.0.x'
18-
19-
- uses: actions/setup-dotnet@v1
20-
with:
21-
dotnet-version: '7.0.x'
22-
17+
dotnet-version: |
18+
6.0.x
19+
7.0.x
20+
8.0.x
21+
2322
- name: Build Projects
2423
run: |
2524
dotnet build ./src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj -c Release -p:buildType=azure-pipelines-ci
2625
26+
- name: Run Tests net8.0
27+
run: |
28+
dotnet build ./test/System.Linq.Dynamic.Core.Tests.Net8/System.Linq.Dynamic.Core.Tests.Net8.csproj -c Release -p:buildType=azure-pipelines-ci
29+
dotnet test ./test/System.Linq.Dynamic.Core.Tests.Net8/System.Linq.Dynamic.Core.Tests.Net8.csproj -c Release -p:buildType=azure-pipelines-ci --no-build
30+
2731
- name: Run Tests net7.0
2832
run: |
2933
dotnet build ./test/System.Linq.Dynamic.Core.Tests.Net7/System.Linq.Dynamic.Core.Tests.Net7.csproj -c Release -p:buildType=azure-pipelines-ci

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ If it's not possible to add that attribute, you need to implement a custom [Cust
7676
The following frameworks are supported:
7777
- net35, net40, net45, net46 and up
7878
- netstandard1.3, netstandard2.0 and netstandard2.1
79-
- netcoreapp3.1, net5.0, net6.0 and net7.0
79+
- netcoreapp3.1, net5.0, net6.0, net7.0 and net8.0
8080
- uap10.0
8181

8282
### Fork details

System.Linq.Dynamic.Core.sln

+38
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.EntityFrameworkCo
132132
EndProject
133133
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Linq.Dynamic.Core.Tests.Net7", "test\System.Linq.Dynamic.Core.Tests.Net7\System.Linq.Dynamic.Core.Tests.Net7.csproj", "{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}"
134134
EndProject
135+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8", "src\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8.csproj", "{9000129D-322D-4FE6-9C47-75464577C374}"
136+
EndProject
137+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Linq.Dynamic.Core.Tests.Net8", "test\System.Linq.Dynamic.Core.Tests.Net8\System.Linq.Dynamic.Core.Tests.Net8.csproj", "{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}"
138+
EndProject
135139
Global
136140
GlobalSection(SolutionConfigurationPlatforms) = preSolution
137141
Debug|Any CPU = Debug|Any CPU
@@ -802,6 +806,38 @@ Global
802806
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x64.Build.0 = Release|Any CPU
803807
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x86.ActiveCfg = Release|Any CPU
804808
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x86.Build.0 = Release|Any CPU
809+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
810+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|Any CPU.Build.0 = Debug|Any CPU
811+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|ARM.ActiveCfg = Debug|Any CPU
812+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|ARM.Build.0 = Debug|Any CPU
813+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x64.ActiveCfg = Debug|Any CPU
814+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x64.Build.0 = Debug|Any CPU
815+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x86.ActiveCfg = Debug|Any CPU
816+
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x86.Build.0 = Debug|Any CPU
817+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|Any CPU.ActiveCfg = Release|Any CPU
818+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|Any CPU.Build.0 = Release|Any CPU
819+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|ARM.ActiveCfg = Release|Any CPU
820+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|ARM.Build.0 = Release|Any CPU
821+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x64.ActiveCfg = Release|Any CPU
822+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x64.Build.0 = Release|Any CPU
823+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x86.ActiveCfg = Release|Any CPU
824+
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x86.Build.0 = Release|Any CPU
825+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
826+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|Any CPU.Build.0 = Debug|Any CPU
827+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|ARM.ActiveCfg = Debug|Any CPU
828+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|ARM.Build.0 = Debug|Any CPU
829+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x64.ActiveCfg = Debug|Any CPU
830+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x64.Build.0 = Debug|Any CPU
831+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x86.ActiveCfg = Debug|Any CPU
832+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x86.Build.0 = Debug|Any CPU
833+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|Any CPU.ActiveCfg = Release|Any CPU
834+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|Any CPU.Build.0 = Release|Any CPU
835+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|ARM.ActiveCfg = Release|Any CPU
836+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|ARM.Build.0 = Release|Any CPU
837+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x64.ActiveCfg = Release|Any CPU
838+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x64.Build.0 = Release|Any CPU
839+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x86.ActiveCfg = Release|Any CPU
840+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x86.Build.0 = Release|Any CPU
805841
EndGlobalSection
806842
GlobalSection(SolutionProperties) = preSolution
807843
HideSolutionNode = FALSE
@@ -848,6 +884,8 @@ Global
848884
{B133DA55-339D-4600-AED3-46214AD9F08A} = {122BC4FA-7563-4E35-9D17-077F16F1629F}
849885
{FB2F4C99-EC34-4D29-87E2-944B25D90EF7} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
850886
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740} = {8463ED7E-69FB-49AE-85CF-0791AFD98E38}
887+
{9000129D-322D-4FE6-9C47-75464577C374} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
888+
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E} = {8463ED7E-69FB-49AE-85CF-0791AFD98E38}
851889
EndGlobalSection
852890
GlobalSection(ExtensibilityGlobals) = postSolution
853891
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
2+
<Import Project="../../version.xml" />
3+
4+
<PropertyGroup>
5+
<AssemblyName>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyName>
6+
<AssemblyOriginatorKeyFile>../Microsoft.EntityFrameworkCore.DynamicLinq.EFCore2/Microsoft.EntityFrameworkCore.DynamicLinq.snk</AssemblyOriginatorKeyFile>
7+
<AssemblyTitle>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyTitle>
8+
<DefineConstants>$(DefineConstants);EFCORE;EFCORE_3X;EFDYNAMICFUNCTIONS;ASYNCENUMERABLE</DefineConstants>
9+
<Description>Dynamic Linq extensions for Microsoft.EntityFrameworkCore which adds Async support</Description>
10+
<PackageTags>system;linq;dynamic;entityframework;core;async</PackageTags>
11+
<ProjectGuid>{9000129D-322D-4FE6-9C47-75464577C374}</ProjectGuid>
12+
<TargetFrameworks>net8.0</TargetFrameworks>
13+
<Version>8.3.$(PatchVersion)</Version>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
17+
<DebugType>full</DebugType>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
21+
<!--<IncludeSource>True</IncludeSource>
22+
<IncludeSymbols>True</IncludeSymbols>
23+
<PathMap>$(MSBuildProjectDirectory)=/</PathMap>-->
24+
<DebugType>portable</DebugType>
25+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
26+
</PropertyGroup>
27+
28+
<PropertyGroup Condition=" '$(buildType)' == 'azure-pipelines-ci' ">
29+
<TargetFrameworks>net8.0</TargetFrameworks>
30+
</PropertyGroup>
31+
32+
<ItemGroup>
33+
<Compile Include="..\System.Linq.Dynamic.Core\Res.cs" />
34+
<Compile Include="..\System.Linq.Dynamic.Core\Compatibility\*.cs" />
35+
<Compile Include="..\System.Linq.Dynamic.Core\Extensions\*.cs" />
36+
<Compile Include="..\System.Linq.Dynamic.Core\Validation\*.cs" />
37+
<Compile Include="..\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore3\*.cs" />
38+
</ItemGroup>
39+
40+
<ItemGroup>
41+
<ProjectReference Include="..\System.Linq.Dynamic.Core\System.Linq.Dynamic.Core.csproj" />
42+
</ItemGroup>
43+
44+
<ItemGroup>
45+
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
46+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
47+
</ItemGroup>
48+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Runtime.InteropServices;
2+
3+
[assembly: ComVisible(false)]
4+
#if !(WINDOWS_APP || NETSTANDARD2_1)
5+
[assembly: Guid("b467c675-c014-4b55-85b9-9578941d2ef7")]
6+
#endif

src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Description>This is a .NETStandard / .NET Core port of the the Microsoft assembly for the .Net 4.0 Dynamic language functionality.</Description>
1010
<PackageTags>system;linq;dynamic;core;dotnet;NETCoreApp;NETStandard</PackageTags>
1111
<ProjectGuid>{D3804228-91F4-4502-9595-39584E510002}</ProjectGuid>
12-
<TargetFrameworks>net35;net40;net45;net452;net46;netstandard1.3;netstandard2.0;netstandard2.1;uap10.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
12+
<TargetFrameworks>net35;net40;net45;net452;net46;netstandard1.3;netstandard2.0;netstandard2.1;uap10.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
1313
<Version>1.3.$(PatchVersion)</Version>
1414
</PropertyGroup>
1515

@@ -26,14 +26,14 @@
2626
</PropertyGroup>
2727

2828
<PropertyGroup Condition=" '$(buildType)' == 'azure-pipelines-ci' ">
29-
<TargetFrameworks>net40;net45;net46;netstandard1.3;netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
29+
<TargetFrameworks>net40;net45;net46;netstandard1.3;netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
3030
</PropertyGroup>
3131

3232
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
3333
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
3434
</PropertyGroup>
3535

36-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
36+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0' ">
3737
<DefineConstants>$(DefineConstants);ASYNCENUMERABLE</DefineConstants>
3838
</PropertyGroup>
3939

test/System.Linq.Dynamic.Core.Tests.Net6/System.Linq.Dynamic.Core.Tests.Net6.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<SignAssembly>True</SignAssembly>
88
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
99
<IsPackable>false</IsPackable>
10-
1110
<DefineConstants>$(DefineConstants);NETCOREAPP;EFCORE;EFCORE_3X;NETCOREAPP3_1</DefineConstants>
1211
</PropertyGroup>
1312

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>System.Linq.Dynamic.Core.Tests</AssemblyName>
6+
<DebugType>full</DebugType>
7+
<SignAssembly>True</SignAssembly>
8+
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
9+
<IsPackable>false</IsPackable>
10+
<Nullable>enable</Nullable>
11+
<DefineConstants>$(DefineConstants);NETCOREAPP;EFCORE;EFCORE_3X;NETCOREAPP3_1</DefineConstants>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageReference>
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
20+
<PackageReference Include="xunit" Version="2.4.2" />
21+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
22+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23+
<PrivateAssets>all</PrivateAssets>
24+
</PackageReference>
25+
<PackageReference Include="coverlet.collector" Version="3.2.0">
26+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27+
<PrivateAssets>all</PrivateAssets>
28+
</PackageReference>
29+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
30+
<PackageReference Include="Linq.PropertyTranslator.Core" Version="1.0.5" />
31+
<PackageReference Include="QueryInterceptor.Core" Version="1.0.7" />
32+
<PackageReference Include="NFluent" Version="2.8.0" />
33+
<PackageReference Include="Moq" Version="4.18.2" />
34+
<PackageReference Include="FluentAssertions" Version="6.8.0" />
35+
36+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
37+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
38+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
39+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
40+
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="8.1.5" />
41+
<PackageReference Include="NodaTime" Version="3.1.5" />
42+
43+
<ProjectReference Include="..\..\src\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8.csproj" />
44+
</ItemGroup>
45+
46+
<ItemGroup>
47+
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*.cs" />
48+
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*\*.cs" />
49+
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*\*\*.cs" />
50+
</ItemGroup>
51+
52+
<ItemGroup>
53+
<Compile Remove="TestResults\**" />
54+
<EmbeddedResource Remove="TestResults\**" />
55+
<None Remove="TestResults\**" />
56+
</ItemGroup>
57+
</Project>

test/System.Linq.Dynamic.Core.Tests/EntitiesTests.FormattableString.cs

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public async Task Entities_LongCountAsync_Predicate_Args_FS()
139139
Assert.Equal(expected, result);
140140
}
141141

142+
[Fact(Skip = "not supported")]
142143
public void Entities_TakeWhile_FS()
143144
{
144145
//Arrange

test/System.Linq.Dynamic.Core.Tests/EntitiesTests.TakeWhile.cs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace System.Linq.Dynamic.Core.Tests
66
public partial class EntitiesTests
77
{
88
// Not supported : https://msdn.microsoft.com/en-in/library/bb738474%28en-us%29.aspx
9+
[Fact(Skip = "not supported")]
910
public void Entities_TakeWhile()
1011
{
1112
//Arrange

test/System.Linq.Dynamic.Core.Tests/Parser/StringParserTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void StringParser_With_UnexpectedUnrecognizedEscapeSequence_ThrowsExcepti
5656
// Assert
5757
var parseException = action.Should().Throw<ParseException>();
5858

59-
parseException.Which.InnerException!.Message.Should().Contain("Insufficient hexadecimal digits");
59+
parseException.Which.InnerException!.Message.Should().Contain("hexadecimal digits");
6060

6161
parseException.Which.StackTrace.Should().Contain("at System.Linq.Dynamic.Core.Parser.StringParser.ParseString(String s) in ").And.Contain("System.Linq.Dynamic.Core\\Parser\\StringParser.cs:line ");
6262
}

test/System.Linq.Dynamic.Core.Tests/QueryableTests.Where.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void Where_Dynamic_Exceptions()
150150
Assert.Throws<ParseException>(() => qry.Where("Id=123"));
151151

152152
Assert.Throws<ArgumentNullException>(() => DynamicQueryableExtensions.Where(null, "Id=1"));
153-
Assert.Throws<ArgumentNullException>(() => qry.Where((string)null));
153+
Assert.Throws<ArgumentNullException>(() => qry.Where((string?)null));
154154
Assert.Throws<ArgumentException>(() => qry.Where(""));
155155
Assert.Throws<ArgumentException>(() => qry.Where(" "));
156156
}

0 commit comments

Comments
 (0)