Skip to content

Commit c6785ff

Browse files
HenkKinHenk Kin
andauthored
Update to net7.0 and EF7 (#5)
Co-authored-by: Henk Kin <[email protected]>
1 parent f500bee commit c6785ff

File tree

16 files changed

+77
-62
lines changed

16 files changed

+77
-62
lines changed

DataAccessClient.EntityFrameworkCore.SqlServer.Tests/DataAccessClient.EntityFrameworkCore.SqlServer.Tests.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
13-
<PackageReference Include="Moq" Version="4.16.1" />
14-
<PackageReference Include="Moq.AutoMock" Version="3.1.0" />
15-
<PackageReference Include="xunit" Version="2.4.1" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
10+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
13+
<PackageReference Include="Moq" Version="4.18.2" />
14+
<PackageReference Include="Moq.AutoMock" Version="3.4.0" />
15+
<PackageReference Include="xunit" Version="2.4.2" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="3.1.0">
20+
<PackageReference Include="coverlet.collector" Version="3.2.0">
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
</PackageReference>

DataAccessClient.EntityFrameworkCore.SqlServer.Tests/TestBase/DbContextTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public DbContextTestBase(string testName)
2929
.UseInMemoryDatabase(testName).EnableSensitiveDataLogging().EnableDetailedErrors()
3030
)
3131
);
32-
ServiceProvider = serviceCollection.BuildServiceProvider().CreateScope().ServiceProvider;
32+
ServiceProvider = serviceCollection.BuildServiceProvider(true).CreateScope().ServiceProvider;
3333
UnitOfWork = ServiceProvider.GetRequiredService<IUnitOfWork>();
3434
TestEntityRepository = ServiceProvider.GetRequiredService<IRepository<TestEntity>>();
3535
TestEntityViewRepository = ServiceProvider.GetRequiredService<IRepository<TestEntityView>>();

DataAccessClient.EntityFrameworkCore.SqlServer/DataAccessClient.EntityFrameworkCore.SqlServer.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Authors>Henk Kin</Authors>
66
<Description>Provides implementation for Data Access with EntityFrameworkCore.SqlServer. It provides implementation for IRepository&lt;T&gt; and DbContext. It also provides extension methods for IServiceCollection to easily adding types to .NET Core DependencyInjection. Is also supports using multiple DbContexts within same IUnitOfWork.</Description>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -13,18 +13,18 @@
1313
<PackageReleaseNotes></PackageReleaseNotes>
1414
<Copyright>Henk Kin</Copyright>
1515
<PackageTags>EntityFrameworkCore, EF, SqlServer, DependencyInjection, Multiple DbContext support, DataAccess, Repository, UnitOfWork, SoftDelete, Translation, Localization, RowVersioning, Multitenancy, Filtering, Paging, Sorting, Includes</PackageTags>
16-
<Version>6.0.0</Version>
16+
<Version>7.0.0</Version>
1717
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1818
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1919
<IncludeSymbols>true</IncludeSymbols>
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
</PropertyGroup>
2222
<ItemGroup>
23-
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="6.0.0" />
23+
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="7.0.0" />
2424
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
25-
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="6.0.27" />
26-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
27-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
25+
<PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="7.1.3" />
26+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.3.1" />
27+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

DataAccessClient.Tests/DataAccessClient.Tests.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
15-
<PackageReference Include="Moq" Version="4.16.1" />
16-
<PackageReference Include="xunit" Version="2.4.1" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
10+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
15+
<PackageReference Include="Moq" Version="4.18.2" />
16+
<PackageReference Include="xunit" Version="2.4.2" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>
21-
<PackageReference Include="coverlet.collector" Version="3.1.0">
21+
<PackageReference Include="coverlet.collector" Version="3.2.0">
2222
<PrivateAssets>all</PrivateAssets>
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2424
</PackageReference>

DataAccessClient.sln

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29324.140
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32811.315
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccessClient", "DataAccessClient\DataAccessClient.csproj", "{4446942B-C7D8-470E-919D-20F28B33499D}"
77
EndProject
@@ -11,14 +11,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
ProjectSection(SolutionItems) = preProject
1212
.bettercodehub.yml = .bettercodehub.yml
1313
appveyor.yml = appveyor.yml
14+
..\EntityCloner.Microsoft.EntityFrameworkCore\EntityCloner.Microsoft.EntityFrameworkCore\NuGet.config = ..\EntityCloner.Microsoft.EntityFrameworkCore\EntityCloner.Microsoft.EntityFrameworkCore\NuGet.config
1415
README.md = README.md
1516
EndProjectSection
1617
EndProject
1718
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccessClient.EntityFrameworkCore.SqlServer", "DataAccessClient.EntityFrameworkCore.SqlServer\DataAccessClient.EntityFrameworkCore.SqlServer.csproj", "{EDC1B0DC-1C14-4FB6-86E2-C163FF0B600F}"
1819
EndProject
19-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccessClient.Tests", "DataAccessClient.Tests\DataAccessClient.Tests.csproj", "{3851FBB3-886B-42C5-B695-936920A472A8}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccessClient.Tests", "DataAccessClient.Tests\DataAccessClient.Tests.csproj", "{3851FBB3-886B-42C5-B695-936920A472A8}"
2021
EndProject
21-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccessClient.EntityFrameworkCore.SqlServer.Tests", "DataAccessClient.EntityFrameworkCore.SqlServer.Tests\DataAccessClient.EntityFrameworkCore.SqlServer.Tests.csproj", "{B2AE5FD4-D99D-4FBD-94D0-86FEF54A9814}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccessClient.EntityFrameworkCore.SqlServer.Tests", "DataAccessClient.EntityFrameworkCore.SqlServer.Tests\DataAccessClient.EntityFrameworkCore.SqlServer.Tests.csproj", "{B2AE5FD4-D99D-4FBD-94D0-86FEF54A9814}"
2223
EndProject
2324
Global
2425
GlobalSection(SolutionConfigurationPlatforms) = preSolution

DataAccessClient/DataAccessClient.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Authors>Henk Kin</Authors>
66
<Company>Henk Kin</Company>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -13,14 +13,14 @@
1313
<PackageTags>DataAccess Repository, UnitOfWork, Multitenancy, SoftDelete, RowVersioning, Filtering, Paging, Translation, Localization, Sorting, Includes</PackageTags>
1414
<Description>Provides interfaces for Data Access with IRepository&lt;T&gt; and IUnitOfWork. Also provides haviorial interfaces for entities like IIdentifiable, ICreatable, IModifiable, ISoftDeletable, ITranslatable, ILocalizable, ITenantScopable and IRowVersioned. Last but not least provides some types for Exceptions and searching capabilities like Filtering,Paging, Sorting and Includes.</Description>
1515
<Copyright>Henk Kin</Copyright>
16-
<Version>6.0.0</Version>
16+
<Version>7.0.0</Version>
1717
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1818
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1919
<IncludeSymbols>true</IncludeSymbols>
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
</PropertyGroup>
2222
<ItemGroup>
23-
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="6.0.0" />
23+
<PackageReference Include="EntityCloner.Microsoft.EntityFrameworkCore" Version="7.0.0" />
2424
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
2525
</ItemGroup>
2626
</Project>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
8+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
99
<PrivateAssets>all</PrivateAssets>
1010
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1111
</PackageReference>
12-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.0" />
1313

1414
</ItemGroup>
1515

@@ -19,6 +19,8 @@
1919

2020
<ItemGroup>
2121
<Folder Include="Migrations\" />
22+
<Folder Include="Migrations\ExampleDatabase\" />
23+
<Folder Include="Migrations\ExampleSecondDatabase\" />
2224
</ItemGroup>
2325

2426
</Project>

DataAccessClientExample/DataLayer/Migrations.readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Installeer de dotnet ef tool (indien nodig)
88
- dotnet tool uninstall --global dotnet-ef
99

1010
// download from https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.302-windows-x64-installer
11-
- dotnet tool install --global dotnet-ef --add-source https://api.nuget.org/v3/index.json --ignore-failed-sources --version 5.0.5
11+
- dotnet tool install --global dotnet-ef --add-source https://api.nuget.org/v3/index.json --ignore-failed-sources --version 7.0.0
1212

1313

1414
dotnet ef migrations Add Initial --context ExampleDbContext --output-dir Migrations/ExampleDatabase

DataAccessClientExample/Migrations/ExampleDatabase/20211115125523_Initial.Designer.cs renamed to DataAccessClientExample/Migrations/ExampleDatabase/20221111064953_Initial.Designer.cs

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataAccessClientExample/Migrations/ExampleDatabase/20211115125523_Initial.cs renamed to DataAccessClientExample/Migrations/ExampleDatabase/20221111064953_Initial.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
namespace DataAccessClientExample.Migrations.ExampleDatabase
77
{
8+
/// <inheritdoc />
89
public partial class Initial : Migration
910
{
11+
/// <inheritdoc />
1012
protected override void Up(MigrationBuilder migrationBuilder)
1113
{
1214
migrationBuilder.CreateTable(
@@ -51,6 +53,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
5153
});
5254
}
5355

56+
/// <inheritdoc />
5457
protected override void Down(MigrationBuilder migrationBuilder)
5558
{
5659
migrationBuilder.DropTable(

0 commit comments

Comments
 (0)