Skip to content

Commit

Permalink
Add support for .NET 8 + Microsoft.EntityFrameworkCore 8 (#756)
Browse files Browse the repository at this point in the history
* Add .NET 8

* fix ci

* readme
  • Loading branch information
StefH authored Nov 20, 2023
1 parent ea4efac commit 3949e67
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 14 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'

dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build Projects
run: |
dotnet build ./src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj -c Release -p:buildType=azure-pipelines-ci
- name: Run Tests net8.0
run: |
dotnet build ./test/System.Linq.Dynamic.Core.Tests.Net8/System.Linq.Dynamic.Core.Tests.Net8.csproj -c Release -p:buildType=azure-pipelines-ci
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
- name: Run Tests net7.0
run: |
dotnet build ./test/System.Linq.Dynamic.Core.Tests.Net7/System.Linq.Dynamic.Core.Tests.Net7.csproj -c Release -p:buildType=azure-pipelines-ci
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If it's not possible to add that attribute, you need to implement a custom [Cust
The following frameworks are supported:
- net35, net40, net45, net46 and up
- netstandard1.3, netstandard2.0 and netstandard2.1
- netcoreapp3.1, net5.0, net6.0 and net7.0
- netcoreapp3.1, net5.0, net6.0, net7.0 and net8.0
- uap10.0

### Fork details
Expand Down
38 changes: 38 additions & 0 deletions System.Linq.Dynamic.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.EntityFrameworkCo
EndProject
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}"
EndProject
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}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -802,6 +806,38 @@ Global
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x64.Build.0 = Release|Any CPU
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x86.ActiveCfg = Release|Any CPU
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740}.Release|x86.Build.0 = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|ARM.ActiveCfg = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|ARM.Build.0 = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x64.ActiveCfg = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x64.Build.0 = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x86.ActiveCfg = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Debug|x86.Build.0 = Debug|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|Any CPU.Build.0 = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|ARM.ActiveCfg = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|ARM.Build.0 = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x64.ActiveCfg = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x64.Build.0 = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x86.ActiveCfg = Release|Any CPU
{9000129D-322D-4FE6-9C47-75464577C374}.Release|x86.Build.0 = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|ARM.Build.0 = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x64.ActiveCfg = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x64.Build.0 = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x86.ActiveCfg = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Debug|x86.Build.0 = Debug|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|Any CPU.Build.0 = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|ARM.ActiveCfg = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|ARM.Build.0 = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x64.ActiveCfg = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x64.Build.0 = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x86.ActiveCfg = Release|Any CPU
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -848,6 +884,8 @@ Global
{B133DA55-339D-4600-AED3-46214AD9F08A} = {122BC4FA-7563-4E35-9D17-077F16F1629F}
{FB2F4C99-EC34-4D29-87E2-944B25D90EF7} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
{CC63ECEB-18C1-462B-BAFC-7F146A7C2740} = {8463ED7E-69FB-49AE-85CF-0791AFD98E38}
{9000129D-322D-4FE6-9C47-75464577C374} = {DBD7D9B6-FCC7-4650-91AF-E6457573A68F}
{ABB1BF71-8927-49BB-99F3-70BCB2CD161E} = {8463ED7E-69FB-49AE-85CF-0791AFD98E38}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="../../version.xml" />

<PropertyGroup>
<AssemblyName>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyName>
<AssemblyOriginatorKeyFile>../Microsoft.EntityFrameworkCore.DynamicLinq.EFCore2/Microsoft.EntityFrameworkCore.DynamicLinq.snk</AssemblyOriginatorKeyFile>
<AssemblyTitle>Microsoft.EntityFrameworkCore.DynamicLinq</AssemblyTitle>
<DefineConstants>$(DefineConstants);EFCORE;EFCORE_3X;EFDYNAMICFUNCTIONS;ASYNCENUMERABLE</DefineConstants>
<Description>Dynamic Linq extensions for Microsoft.EntityFrameworkCore which adds Async support</Description>
<PackageTags>system;linq;dynamic;entityframework;core;async</PackageTags>
<ProjectGuid>{9000129D-322D-4FE6-9C47-75464577C374}</ProjectGuid>
<TargetFrameworks>net8.0</TargetFrameworks>
<Version>8.3.$(PatchVersion)</Version>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<!--<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
<PathMap>$(MSBuildProjectDirectory)=/</PathMap>-->
<DebugType>portable</DebugType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(buildType)' == 'azure-pipelines-ci' ">
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\System.Linq.Dynamic.Core\Res.cs" />
<Compile Include="..\System.Linq.Dynamic.Core\Compatibility\*.cs" />
<Compile Include="..\System.Linq.Dynamic.Core\Extensions\*.cs" />
<Compile Include="..\System.Linq.Dynamic.Core\Validation\*.cs" />
<Compile Include="..\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore3\*.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\System.Linq.Dynamic.Core\System.Linq.Dynamic.Core.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]
#if !(WINDOWS_APP || NETSTANDARD2_1)
[assembly: Guid("b467c675-c014-4b55-85b9-9578941d2ef7")]
#endif
6 changes: 3 additions & 3 deletions src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Description>This is a .NETStandard / .NET Core port of the the Microsoft assembly for the .Net 4.0 Dynamic language functionality.</Description>
<PackageTags>system;linq;dynamic;core;dotnet;NETCoreApp;NETStandard</PackageTags>
<ProjectGuid>{D3804228-91F4-4502-9595-39584E510002}</ProjectGuid>
<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>
<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>
<Version>1.3.$(PatchVersion)</Version>
</PropertyGroup>

Expand All @@ -26,14 +26,14 @@
</PropertyGroup>

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>

<DefineConstants>$(DefineConstants);NETCOREAPP;EFCORE;EFCORE_3X;NETCOREAPP3_1</DefineConstants>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>System.Linq.Dynamic.Core.Tests</AssemblyName>
<DebugType>full</DebugType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>../../src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);NETCOREAPP;EFCORE;EFCORE_3X;NETCOREAPP3_1</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Linq.PropertyTranslator.Core" Version="1.0.5" />
<PackageReference Include="QueryInterceptor.Core" Version="1.0.7" />
<PackageReference Include="NFluent" Version="2.8.0" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="8.1.5" />
<PackageReference Include="NodaTime" Version="3.1.5" />

<ProjectReference Include="..\..\src\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8\Microsoft.EntityFrameworkCore.DynamicLinq.EFCore8.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*.cs" />
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*\*.cs" />
<Compile Include="..\System.Linq.Dynamic.Core.Tests\*\*\*.cs" />
</ItemGroup>

<ItemGroup>
<Compile Remove="TestResults\**" />
<EmbeddedResource Remove="TestResults\**" />
<None Remove="TestResults\**" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public async Task Entities_LongCountAsync_Predicate_Args_FS()
Assert.Equal(expected, result);
}

[Fact(Skip = "not supported")]
public void Entities_TakeWhile_FS()
{
//Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace System.Linq.Dynamic.Core.Tests
public partial class EntitiesTests
{
// Not supported : https://msdn.microsoft.com/en-in/library/bb738474%28en-us%29.aspx
[Fact(Skip = "not supported")]
public void Entities_TakeWhile()
{
//Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void StringParser_With_UnexpectedUnrecognizedEscapeSequence_ThrowsExcepti
// Assert
var parseException = action.Should().Throw<ParseException>();

parseException.Which.InnerException!.Message.Should().Contain("Insufficient hexadecimal digits");
parseException.Which.InnerException!.Message.Should().Contain("hexadecimal digits");

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 ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void Where_Dynamic_Exceptions()
Assert.Throws<ParseException>(() => qry.Where("Id=123"));

Assert.Throws<ArgumentNullException>(() => DynamicQueryableExtensions.Where(null, "Id=1"));
Assert.Throws<ArgumentNullException>(() => qry.Where((string)null));
Assert.Throws<ArgumentNullException>(() => qry.Where((string?)null));
Assert.Throws<ArgumentException>(() => qry.Where(""));
Assert.Throws<ArgumentException>(() => qry.Where(" "));
}
Expand Down

0 comments on commit 3949e67

Please sign in to comment.