Skip to content

Commit 0725a83

Browse files
authored
Merge pull request #216 from EFNext/upgrade-net8-9-10
Upgrade to net8, net9 and net10
2 parents fc0ca32 + ea5e163 commit 0725a83

40 files changed

Lines changed: 280 additions & 323 deletions

File tree

.github/workflows/build.yml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
release:
66
types:
77
- published
8-
8+
99
env:
1010
# Stop wasting time caching packages
1111
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -15,42 +15,33 @@ env:
1515
GITHUB_FEED: https://nuget.pkg.github.com/koenbeuk/
1616
GITHUB_USER: koenbeuk
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
18+
1919
jobs:
2020
build:
2121
strategy:
2222
matrix:
2323
os: [ubuntu-latest, windows-latest, macos-latest]
24-
version: [1, 2, 3]
25-
include:
26-
- version: 1
27-
configuration: ReleaseV1
28-
- version: 2
29-
configuration: ReleaseV2
30-
- version: 3
31-
configuration: Release
32-
runs-on: ${{ matrix.os }}
24+
runs-on: ${{ matrix.os }}
3325

3426
steps:
35-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
3628
- name: Setup .NET Core
37-
uses: actions/setup-dotnet@v1
29+
uses: actions/setup-dotnet@v4
3830
with:
39-
dotnet-version: 6.0.x
40-
include-prerelease: True
31+
global-json-file: global.json
4132
- name: Install dependencies
42-
run: dotnet restore EntityFrameworkCore.Triggered.sln -p:Configuration=${{ matrix.configuration }}
33+
run: dotnet restore EntityFrameworkCore.Triggered.sln -p:Configuration=Release
4334
- name: Build
44-
run: dotnet build --configuration ${{ matrix.configuration }} --no-restore EntityFrameworkCore.Triggered.sln
35+
run: dotnet build --configuration Release --no-restore EntityFrameworkCore.Triggered.sln
4536
- name: Test
46-
run: dotnet test --configuration ${{ matrix.configuration }} --verbosity normal EntityFrameworkCore.Triggered.sln
37+
run: dotnet test --configuration Release --verbosity normal EntityFrameworkCore.Triggered.sln
4738
- name: Pack
4839
if: matrix.os == 'ubuntu-latest'
49-
run: |
50-
dotnet pack -v normal --configuration ${{ matrix.configuration }} --include-symbols --include-source -p:PackageVersion=${{ matrix.version }}-pre-$GITHUB_RUN_ID -o nupkg EntityFrameworkCore.Triggered.Core.slnf
40+
run: |
41+
dotnet pack -v normal --configuration Release --include-symbols --include-source -p:PackageVersion=3-pre-$GITHUB_RUN_ID -o nupkg EntityFrameworkCore.Triggered.Core.slnf
5142
- name: Upload Artifact
5243
if: matrix.os == 'ubuntu-latest'
53-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
5445
with:
5546
name: nupkg
5647
path: ./nupkg/*.nupkg
@@ -59,32 +50,32 @@ jobs:
5950
strategy:
6051
matrix:
6152
os: [ubuntu-latest, windows-latest, macos-latest]
62-
runs-on: ${{ matrix.os }}
63-
53+
runs-on: ${{ matrix.os }}
54+
6455
steps:
65-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v4
6657
- name: Setup .NET Core
67-
uses: actions/setup-dotnet@v1
58+
uses: actions/setup-dotnet@v4
6859
with:
69-
dotnet-version: 6.0.x
70-
include-prerelease: True
60+
global-json-file: global.json
7161
- name: Install dependencies
7262
run: dotnet restore EntityFrameworkCore.Triggered.Samples.slnf
7363
- name: Build
74-
run: dotnet build --configuration Release --no-restore EntityFrameworkCore.Triggered.Samples.slnf
75-
64+
run: dotnet build --configuration Release --no-restore EntityFrameworkCore.Triggered.Samples.slnf
65+
7666
prerelease:
7767
needs: build
7868
if: github.ref == 'refs/heads/master'
7969
runs-on: ubuntu-latest
8070
steps:
8171
- name: Download Artifact
82-
uses: actions/download-artifact@v1
72+
uses: actions/download-artifact@v4
8373
with:
8474
name: nupkg
75+
path: nupkg
8576
- name: Push to GitHub Feed
8677
run: |
8778
for f in ./nupkg/*.nupkg
8879
do
8980
dotnet nuget push $f --source $GITHUB_FEED --api-key ${{github.token}} --skip-duplicate --no-symbols
90-
done
81+
done

.github/workflows/release.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
release:
44
types:
55
- published
6-
6+
77
env:
88
# Stop wasting time caching packages
99
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -16,27 +16,24 @@ env:
1616
# Official NuGet Feed settings
1717
NUGET_FEED: https://api.nuget.org/v3/index.json
1818
NUGET_KEY: ${{ secrets.NUGET_KEY }}
19-
19+
2020
jobs:
2121
deploy:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- name: Setup .NET Core
26-
uses: actions/setup-dotnet@v1
26+
uses: actions/setup-dotnet@v4
2727
with:
28-
dotnet-version: 6.0.x
28+
global-json-file: global.json
2929
- name: Create Release NuGet package
3030
run: |
3131
arrTag=(${GITHUB_REF//\// })
3232
VERSION="${arrTag[2]}"
3333
echo Version: $VERSION
34-
CONFIGURATION=$([ "${VERSION:0:2}" == "v1" ] && echo "ReleaseV1" || echo "Release")
35-
CONFIGURATION=$([ "${VERSION:0:2}" == "v2" ] && echo "ReleaseV2" || echo $CONFIGURATION)
3634
VERSION="${VERSION:1}"
3735
echo Clean Version: $VERSION
38-
echo Configuration: $CONFIGURATION
39-
dotnet pack -v normal -c $CONFIGURATION --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg EntityFrameworkCore.Triggered.Core.slnf
36+
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg EntityFrameworkCore.Triggered.Core.slnf
4037
- name: Push to GitHub Feed
4138
run: |
4239
for f in ./nupkg/*.nupkg
@@ -48,4 +45,4 @@ jobs:
4845
for f in ./nupkg/*.nupkg
4946
do
5047
dotnet nuget push $f --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY
51-
done
48+
done

Directory.Build.props

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
11
<Project>
22

3-
<PropertyGroup>
4-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5-
<LangVersion>9.0</LangVersion>
6-
<Nullable>enable</Nullable>
7-
<EnableNETAnalyzers>true</EnableNETAnalyzers>
8-
<Configurations>Debug;Release</Configurations>
9-
<PackageReadmeFile>README.md</PackageReadmeFile>
10-
</PropertyGroup>
3+
<PropertyGroup>
4+
<LangVersion>12</LangVersion>
5+
<Nullable>enable</Nullable>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
8+
<PackageReadmeFile>README.md</PackageReadmeFile>
9+
</PropertyGroup>
1110

12-
<PropertyGroup>
13-
<Description>Triggers for EF Core. Respond to changes in your ApplicationDbContext before and after they are committed to the database</Description>
14-
<RepositoryType>Git</RepositoryType>
15-
<RepositoryUrl>https://github.com/koenbeuk/EntityFrameworkCore.Triggered</RepositoryUrl>
16-
<Authors>Koen Bekkenutte</Authors>
17-
<PackageTags>EntityFramework;EFCore;Triggers;SQLServer;SqlLite;CosmosDb;.NET Core;aspnetcore</PackageTags>
18-
<PackageProjectUrl>https://github.com/koenbeuk/EntityFrameworkCore.Triggered</PackageProjectUrl>
19-
</PropertyGroup>
20-
21-
<PropertyGroup>
22-
<EFCoreTriggeredVersion>3</EFCoreTriggeredVersion>
23-
<EFCorePackageVersion>6.0.0</EFCorePackageVersion>
24-
<MicrosoftExtensionsVersion>6.0.0</MicrosoftExtensionsVersion>
25-
</PropertyGroup>
11+
<PropertyGroup>
12+
<Description>Triggers for EF Core. Respond to changes in your ApplicationDbContext before and after they are committed to the database</Description>
13+
<RepositoryType>Git</RepositoryType>
14+
<RepositoryUrl>https://github.com/koenbeuk/EntityFrameworkCore.Triggered</RepositoryUrl>
15+
<Authors>Koen Bekkenutte</Authors>
16+
<PackageTags>EntityFramework;EFCore;Triggers;SQLServer;SqlLite;CosmosDb;.NET Core;aspnetcore</PackageTags>
17+
<PackageProjectUrl>https://github.com/koenbeuk/EntityFrameworkCore.Triggered</PackageProjectUrl>
18+
</PropertyGroup>
2619

27-
<ItemGroup>
28-
<None Include="$(SolutionDir)\README.md" Pack="true" PackagePath="\"></None>
29-
</ItemGroup>
20+
<ItemGroup>
21+
<None Include="$(SolutionDir)\README.md" Pack="true" PackagePath="\" />
22+
</ItemGroup>
3023

3124
</Project>

Directory.Packages.props

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
6+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
7+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
8+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.10" />
9+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.10" />
10+
</ItemGroup>
11+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
12+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
13+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
14+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
15+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
16+
</ItemGroup>
17+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
18+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
19+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
20+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
21+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
22+
</ItemGroup>
23+
<ItemGroup>
24+
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
25+
<PackageVersion Include="coverlet.collector" Version="8.0.1" />
26+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
27+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
28+
<PackageVersion Include="Verify.Xunit" Version="31.12.5" />
29+
<PackageVersion Include="xunit" Version="2.9.3" />
30+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
31+
<PackageVersion Include="ScenarioTests.XUnit" Version="1.0.1" />
32+
</ItemGroup>
33+
</Project>

EntityFrameworkCore.Triggered.sln

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
44
VisualStudioVersion = 17.0.31710.8
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EDFABD48-3C79-47AE-B84C-47CE2A52C20D}"
7+
ProjectSection(SolutionItems) = preProject
8+
src\Directory.Build.props = src\Directory.Build.props
9+
EndProjectSection
710
EndProject
811
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0FAE4F6A-93BB-453C-8FB4-B24A9F30DA59}"
12+
ProjectSection(SolutionItems) = preProject
13+
test\Directory.Build.props = test\Directory.Build.props
14+
EndProjectSection
915
EndProject
1016
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution Items", "_Solution Items", "{CA7737C4-0D3C-4B81-B34C-B4812B54C018}"
1117
ProjectSection(SolutionItems) = preProject
1218
.editorconfig = .editorconfig
1319
Directory.Build.props = Directory.Build.props
1420
LICENSE.md = LICENSE.md
1521
README.md = README.md
22+
Directory.Packages.props = Directory.Packages.props
23+
global.json = global.json
1624
EndProjectSection
1725
EndProject
1826
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkCore.Triggered.Abstractions", "src\EntityFrameworkCore.Triggered.Abstractions\EntityFrameworkCore.Triggered.Abstractions.csproj", "{B338AEB6-4D18-4069-AE00-9A1E33C638F4}"
@@ -47,6 +55,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "3 - StudentManagerAspNetCor
4755
EndProject
4856
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "4 - BlazorTests", "samples\4 - BlazorTests\4 - BlazorTests.csproj", "{C764B357-8ABE-483E-BA1D-EC05ED689691}"
4957
EndProject
58+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Github", "_Github", "{BCBB4711-7968-44C0-81BD-C848FF4FBAB8}"
59+
EndProject
60+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{46951DC8-925A-4542-99FC-2C2B3E00A997}"
61+
ProjectSection(SolutionItems) = preProject
62+
.github\workflows\build.yml = .github\workflows\build.yml
63+
.github\workflows\release.yml = .github\workflows\release.yml
64+
EndProjectSection
65+
EndProject
5066
Global
5167
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5268
Debug|Any CPU = Debug|Any CPU
@@ -244,6 +260,7 @@ Global
244260
{6139FBAB-0224-42ED-8DAF-54ED1F3E8C5B} = {FB5C3BC0-5036-4DD6-85E2-E2B05ECAC40C}
245261
{6D1D3A38-523A-44A8-A3F9-B78E34706B37} = {FB5C3BC0-5036-4DD6-85E2-E2B05ECAC40C}
246262
{C764B357-8ABE-483E-BA1D-EC05ED689691} = {FB5C3BC0-5036-4DD6-85E2-E2B05ECAC40C}
263+
{46951DC8-925A-4542-99FC-2C2B3E00A997} = {BCBB4711-7968-44C0-81BD-C848FF4FBAB8}
247264
EndGlobalSection
248265
GlobalSection(ExtensibilityGlobals) = postSolution
249266
SolutionGuid = {847A0017-23D6-4513-B78E-CAADBD836A7D}

benchmarks/EntityFrameworkCore.Triggered.Benchmarks/EntityFrameworkCore.Triggered.Benchmarks.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net6.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66
<PropertyGroup>
@@ -12,8 +12,8 @@
1212
<Configuration>Release</Configuration>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0-rc.1.21452.10" />
15+
<PackageReference Include="BenchmarkDotNet" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<ProjectReference Include="..\..\src\EntityFrameworkCore.Triggered\EntityFrameworkCore.Triggered.csproj" />

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100",
4+
"rollForward": "latestMinor"
5+
}
6+
}
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
6-
<RootNamespace>HelloWorld</RootNamespace>
7-
<Nullable>disable</Nullable>
8-
</PropertyGroup>
9-
10-
<ItemGroup>
11-
<PackageReference Include="EntityFrameworkCore.Triggered" Version="$(EFCoreTriggeredPackageVersion)" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFCorePackageVersion)" />
13-
</ItemGroup>
14-
15-
</Project>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<RootNamespace>HelloWorld</RootNamespace>
7+
<Nullable>disable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\EntityFrameworkCore.Triggered\EntityFrameworkCore.Triggered.csproj" />
16+
</ItemGroup>
17+
18+
</Project>

samples/1 - HelloWorld/Triggers/StudentAssignRegistrationDate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace PrimarySchool.Triggers
77
{
8-
public class StudentAssignRegistrationDate : IBeforeSaveTrigger<Student>
8+
public class StudentAssignRegistrationDate : IBeforeSaveAsyncTrigger<Student>
99
{
10-
public Task BeforeSave(ITriggerContext<Student> context, CancellationToken cancellationToken)
10+
public Task BeforeSaveAsync(ITriggerContext<Student> context, CancellationToken cancellationToken)
1111
{
1212
if (context.ChangeType == ChangeType.Added)
1313
{
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk.Worker">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
6-
<RootNamespace>PrimarySchool</RootNamespace>
7-
<Nullable>disable</Nullable>
8-
</PropertyGroup>
9-
10-
<ItemGroup>
11-
<PackageReference Include="EntityFrameworkCore.Triggered" Version="$(EFCoreTriggeredPackageVersion)" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFCorePackageVersion)" />
13-
</ItemGroup>
14-
15-
</Project>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<RootNamespace>PrimarySchool</RootNamespace>
7+
<Nullable>disable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\EntityFrameworkCore.Triggered\EntityFrameworkCore.Triggered.csproj" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)