Skip to content

Commit 838456e

Browse files
committed
Update to .NET 5, EF Core 5
1 parent 0a1a3ca commit 838456e

File tree

9 files changed

+27
-28
lines changed

9 files changed

+27
-28
lines changed

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Sample using Unit of Work and Repository Framework (URF) with ASP.NET Core 3.x
44

55
## Prerequisites
66

7-
- .NET Core SDK [latest 3.x version](https://dotnet.microsoft.com/download/dotnet-core)
7+
- .NET Core SDK (https://dotnet.microsoft.com/download/dotnet-core)
88
- EF Core CLI (specify current version)
99
```
1010
dotnet tool uninstall --global dotnet-ef
11-
dotnet tool install --global dotnet-ef --version 3.1.2
11+
dotnet tool install --global dotnet-ef
1212
```
1313
1414
## EF Core Code First

URF.Core.Sample.v3.Abstractions/URF.Core.Sample.v3.Abstractions.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<PackageReference Include="URF.Core.Abstractions" Version="3.1.0" />
9+
<PackageReference Include="URF.Core.Abstractions" Version="3.1.3" />
910
</ItemGroup>
1011

1112
<ItemGroup>

URF.Core.Sample.v3.Api/URF.Core.Sample.v3.Api.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
5+
<LangVersion>Latest</LangVersion>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.2" />
9-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
10-
<PackageReference Include="URF.Core.EF" Version="3.1.0" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
10+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0" />
11+
<PackageReference Include="URF.Core.EF" Version="5.0.0" />
1112
</ItemGroup>
1213

1314
<ItemGroup>

URF.Core.Sample.v3.EF/Migrations/20200314141715_initial.Designer.cs renamed to URF.Core.Sample.v3.EF/Migrations/20201124221503_initial.Designer.cs

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

URF.Core.Sample.v3.EF/Migrations/20200314141715_initial.cs renamed to URF.Core.Sample.v3.EF/Migrations/20201124221503_initial.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
1010
name: "Products",
1111
columns: table => new
1212
{
13-
Id = table.Column<int>(nullable: false)
13+
Id = table.Column<int>(type: "int", nullable: false)
1414
.Annotation("SqlServer:Identity", "1, 1"),
15-
ProductName = table.Column<string>(nullable: true),
16-
UnitPrice = table.Column<decimal>(nullable: false)
15+
ProductName = table.Column<string>(type: "nvarchar(max)", nullable: true),
16+
UnitPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
1717
},
1818
constraints: table =>
1919
{

URF.Core.Sample.v3.EF/Migrations/UrfSampleContextModelSnapshot.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1414
{
1515
#pragma warning disable 612, 618
1616
modelBuilder
17-
.HasAnnotation("ProductVersion", "3.1.2")
17+
.UseIdentityColumns()
1818
.HasAnnotation("Relational:MaxIdentifierLength", 128)
19-
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
19+
.HasAnnotation("ProductVersion", "5.0.0");
2020

2121
modelBuilder.Entity("URF.Core.Sample.v3.Models.Product", b =>
2222
{
2323
b.Property<int>("Id")
2424
.ValueGeneratedOnAdd()
2525
.HasColumnType("int")
26-
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
26+
.UseIdentityColumn();
2727

2828
b.Property<string>("ProductName")
2929
.HasColumnType("nvarchar(max)");

URF.Core.Sample.v3.EF/URF.Core.Sample.v3.EF.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2">
9-
<PrivateAssets>all</PrivateAssets>
10-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11-
</PackageReference>
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.2" />
13-
<PackageReference Include="URF.Core.EF" Version="3.1.0" />
8+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
10+
<PackageReference Include="URF.Core.EF" Version="5.0.0" />
1411
</ItemGroup>
1512

1613
<ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "3.1.102"
3+
"version": "5.0.100"
44
}
55
}

0 commit comments

Comments
 (0)