From c96b55950009aaa63b0b0a6c2fcef28028ac4e51 Mon Sep 17 00:00:00 2001 From: Artiom Chilaru Date: Sun, 11 Jul 2021 16:46:53 +0100 Subject: [PATCH] Adding .NET 6 preview builds support Temporarily adding .NET 6 download to github actions --- .github/workflows/build-full.yml | 16 +++++++++---- .github/workflows/build-quick.yml | 8 +++++-- FlexLabs.Upsert.sln | 4 ++-- ...FlexLabs.EntityFrameworkCore.Upsert.csproj | 16 ++++++++++--- ...ameworkCore.Upsert.IntegrationTests.csproj | 24 ++++++++++++++----- ...bs.EntityFrameworkCore.Upsert.Tests.csproj | 16 +++++++++++-- .../RelationalCommandRunnerTestsBase.cs | 7 ++++-- 7 files changed, 70 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-full.yml b/.github/workflows/build-full.yml index 933e8ff..bb8164d 100644 --- a/.github/workflows/build-full.yml +++ b/.github/workflows/build-full.yml @@ -31,17 +31,25 @@ jobs: ACCEPT_EULA: Y SA_PASSWORD: Password12! steps: + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0' + include-prerelease: True - uses: actions/checkout@v2 - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore /p:CORE_ONLY=true + run: dotnet build --no-restore /p:CORE_ONLY=true /p:V6_ONLY=true - name: Test - run: dotnet test --no-build /p:CORE_ONLY=true + run: dotnet test --no-build /p:V6_ONLY=true build-windows: runs-on: windows-latest steps: + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0' + include-prerelease: True - uses: actions/checkout@v2 - name: Enable Postgres run: sc config postgresql-x64-13 start= demand @@ -50,6 +58,6 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore /p:POSTGRES_ONLY=true + run: dotnet build --no-restore /p:POSTGRES_ONLY=true /p:V6_ONLY=true - name: Test - run: dotnet test --no-build + run: dotnet test --no-build /p:V6_ONLY=true diff --git a/.github/workflows/build-quick.yml b/.github/workflows/build-quick.yml index f622933..86459b4 100644 --- a/.github/workflows/build-quick.yml +++ b/.github/workflows/build-quick.yml @@ -6,10 +6,14 @@ jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0' + include-prerelease: True - uses: actions/checkout@v2 - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore /p:CORE_ONLY=true + run: dotnet build --no-restore /p:CORE_ONLY=true /p:V6_ONLY=true - name: Test - run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.Tests --no-build /p:CORE_ONLY=true + run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.Tests --no-build /p:V6_ONLY=true diff --git a/FlexLabs.Upsert.sln b/FlexLabs.Upsert.sln index 2b0fe61..6149f2f 100644 --- a/FlexLabs.Upsert.sln +++ b/FlexLabs.Upsert.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29123.89 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31410.414 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".solution", ".solution", "{8F601D76-FA75-4B32-AACB-559A63305223}" ProjectSection(SolutionItems) = preProject diff --git a/src/FlexLabs.EntityFrameworkCore.Upsert/FlexLabs.EntityFrameworkCore.Upsert.csproj b/src/FlexLabs.EntityFrameworkCore.Upsert/FlexLabs.EntityFrameworkCore.Upsert.csproj index d214249..3087dba 100644 --- a/src/FlexLabs.EntityFrameworkCore.Upsert/FlexLabs.EntityFrameworkCore.Upsert.csproj +++ b/src/FlexLabs.EntityFrameworkCore.Upsert/FlexLabs.EntityFrameworkCore.Upsert.csproj @@ -1,7 +1,7 @@ - netstandard2.1;net5.0 + net5.0;net6.0 latest en enable @@ -20,8 +20,11 @@ Also supports injecting sql command generators to add support for other provider https://github.com/artiomchi/FlexLabs.Upsert MIT Entity Framework Core entity-framework-core EF EntityFramework EntityFrameworkCore EFCore Upsert - 5.0.0 + 6.0.0 +v6.0.0 ++ Adding support for EF Core 6 + v5.0.0 ! Fixing the library versioning. From now one, one version of the library depends on one version of EF Core, for all supported target frameworks @@ -48,13 +51,20 @@ v4.0.0 - + + + + + + + + True diff --git a/test/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests.csproj b/test/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests.csproj index 20e04e7..02b86e4 100644 --- a/test/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests.csproj +++ b/test/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net5.0 + net5.0;net6.0 latest EF1001 false @@ -11,16 +11,20 @@ $(DefineConstants);NOMSSQL;NOMYSQL;POSTGRES_ONLY + + net6.0 + + - - - + + + - + - + all @@ -33,6 +37,14 @@ + + + + + + + + PreserveNewest diff --git a/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/FlexLabs.EntityFrameworkCore.Upsert.Tests.csproj b/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/FlexLabs.EntityFrameworkCore.Upsert.Tests.csproj index c19e82d..ea4daf1 100644 --- a/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/FlexLabs.EntityFrameworkCore.Upsert.Tests.csproj +++ b/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/FlexLabs.EntityFrameworkCore.Upsert.Tests.csproj @@ -1,15 +1,19 @@  - netcoreapp3.1;net5.0 + net5.0;net6.0 latest EF1001 false + + net6.0 + + - + @@ -25,6 +29,14 @@ + + + + + + + + diff --git a/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/Runners/RelationalCommandRunnerTestsBase.cs b/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/Runners/RelationalCommandRunnerTestsBase.cs index b040ce3..777fbd7 100644 --- a/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/Runners/RelationalCommandRunnerTestsBase.cs +++ b/test/FlexLabs.EntityFrameworkCore.Upsert.Tests/Runners/RelationalCommandRunnerTestsBase.cs @@ -68,9 +68,12 @@ private static void AddEntity(Model model) var entityType = model.AddEntityType(clrType, ConfigurationSource.Convention); foreach (var property in clrType.GetProperties()) { - entityType.AddProperty(property.Name); + entityType.AddProperty(property.Name, ConfigurationSource.Explicit); } - entityType.AddKey(entityType.GetProperty("ID") as Property, ConfigurationSource.Convention); + var idProperty = entityType.FindProperty("ID"); + if (idProperty == null) + throw new InvalidOperationException("ID property missing on entity " + typeof(TEntity).Name); + entityType.AddKey(idProperty, ConfigurationSource.Convention); } protected abstract string NoUpdate_Sql { get; }