Skip to content

Commit bf88e4d

Browse files
neonbonesAsylgareev Rustam
andauthored
Update net core version to 3.1 (#1)
* Update net core version to 3.1 * Removed spaces * Updated build and release versions * Fixed build yaml Co-authored-by: Asylgareev Rustam <rustam@smarthead.ru>
1 parent 697cb2a commit bf88e4d

8 files changed

Lines changed: 29 additions & 32 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup .NET Environment.
1313
uses: actions/setup-dotnet@v1
1414
with:
15-
dotnet-version: '2.2.401'
15+
dotnet-version: '3.1.101'
1616
- name: Build and run tests.
1717
run: |
1818
cd src/

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup .NET Environment.
1111
uses: actions/setup-dotnet@v1
1212
with:
13-
dotnet-version: '2.2.401'
13+
dotnet-version: '3.1.1'
1414
- name: Build package for Release.
1515
run: |
1616
cd src/

src/EF.DataProtection.Core.Tests/EF.DataProtection.Core.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
@@ -12,11 +12,7 @@
1212
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
1313
</ItemGroup>
1414

15-
<ItemGroup>
16-
<Folder Include="Fixtures" />
17-
</ItemGroup>
18-
19-
<ItemGroup>
15+
<ItemGroup>
2016
<ProjectReference Include="..\EF.DataProtection.Core\EF.DataProtection.Core.csproj" />
2117
</ItemGroup>
2218

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

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AssemblyName>EF.DataProtection.Core</AssemblyName>
66
<PackageId>EF.DataProtection.Core</PackageId>
7-
<Version>0.1.3</Version>
7+
<Version>0.1.4</Version>
88
<PackageProjectUrl>https://github.com/qdimka/EntityFramework.DataProtection</PackageProjectUrl>
99
<IsTestProject>false</IsTestProject>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.6" />
14-
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" />
14+
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.1" />
1515
</ItemGroup>
1616

1717
</Project>

src/EF.DataProtection.Sample.Tests/Controller/UsersControllerTests.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,19 @@ public async Task Should_CreateUser_WithoutError()
3232
new StringContent(JsonConvert.SerializeObject(user), Encoding.UTF8, "application/json"));
3333

3434
response.EnsureSuccessStatusCode();
35-
36-
var userId = await response
37-
.Content
38-
.ReadAsAsync<long>();
35+
36+
var userId = await response.Content
37+
.ReadAsStringAsync();
3938

4039
var usersResponse = await _httpClient
4140
.GetAsync($"api/users/{userId}");
4241

4342
usersResponse.EnsureSuccessStatusCode();
4443

45-
var userFromDatabase = await usersResponse
46-
.Content
47-
.ReadAsAsync<UserDto>();
48-
44+
var stream = await usersResponse.Content.ReadAsStringAsync();
45+
46+
var userFromDatabase = JsonConvert.DeserializeObject<UserDto>(stream);
47+
4948
Assert.NotNull(userFromDatabase);
5049
Assert.Equal(user.Email, userFromDatabase.PersonalData.Email);
5150
Assert.Equal(user.SensitiveData, userFromDatabase.PersonalData.SensitiveData);

src/EF.DataProtection.Sample.Tests/EF.DataProtection.Sample.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55

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

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.App" Version="3.1.1" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.1" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
13+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1314
<PackageReference Include="xunit" Version="2.4.0" />
1415
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
1516
</ItemGroup>

src/EF.DataProtection.Sample/EF.DataProtection.Sample.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.AspNetCore.App" />
1010
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/EF.DataProtection.Sample/Startup.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.EntityFrameworkCore;
88
using Microsoft.Extensions.Configuration;
99
using Microsoft.Extensions.DependencyInjection;
10+
using Microsoft.Extensions.Hosting;
1011

1112
namespace EF.DataProtection.Sample
1213
{
@@ -44,12 +45,12 @@ public void ConfigureServices(IServiceCollection services)
4445
.UseSha512(opt => { opt.Password = "Really_Strong_Password_For_Data"; });
4546

4647
services
47-
.AddMvc()
48-
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
48+
.AddControllers()
49+
.SetCompatibilityVersion(CompatibilityVersion.Latest);
4950
}
5051

5152
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
52-
public void Configure(IApplicationBuilder app, IHostingEnvironment env, SampleDbContext dbContext)
53+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, SampleDbContext dbContext)
5354
{
5455
dbContext.Database.EnsureCreated();
5556

@@ -62,9 +63,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, SampleDb
6263
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
6364
app.UseHsts();
6465
}
65-
66+
app.UseRouting();
6667
app.UseHttpsRedirection();
67-
app.UseMvc();
68+
app.UseEndpoints(x => x.MapControllers());
6869
}
6970
}
7071
}

0 commit comments

Comments
 (0)