Skip to content

Commit 8a9c9eb

Browse files
update netcoreapp3.1
1 parent 13de541 commit 8a9c9eb

File tree

5 files changed

+61
-36
lines changed

5 files changed

+61
-36
lines changed
Lines changed: 3 additions & 2 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
</PropertyGroup>
66

77
<ItemGroup>
88
<Folder Include="Models\" />
99
<Folder Include="Services\" />
1010
</ItemGroup>
11+
1112
<ItemGroup>
12-
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.2.0" />
1313
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.10" />
1415
</ItemGroup>
1516
</Project>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

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

77
<ItemGroup>
@@ -11,8 +11,11 @@
1111
<Folder Include="Data\" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.10" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.10" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.10">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1720
</ItemGroup>
1821
</Project>

CS321_W5D2_BlogAPI/CS321_W5D2_BlogAPI.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
66
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
77
<IsPackable>false</IsPackable>
@@ -10,8 +10,9 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.App" />
14-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
13+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.10" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.10" />
1516
</ItemGroup>
1617

1718
<ItemGroup>
@@ -45,7 +46,7 @@
4546
<!-- Include the newly-built files in the publish output -->
4647
<ItemGroup>
4748
<DistFiles Include="$(SpaRoot)build\**" />
48-
<ResolvedFileToPublish Include="@(DistFiles-&gt;'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
49+
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
4950
<RelativePath>%(DistFiles.Identity)</RelativePath>
5051
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
5152
</ResolvedFileToPublish>

CS321_W5D2_BlogAPI/ClientApp/package-lock.json

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

CS321_W5D2_BlogAPI/Startup.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
using System.Text;
22
using CS321_W5D2_BlogAPI.Core.Models;
3-
using CS321_W5D2_BlogAPI.Core.Services;
3+
using CS321_W5D2_BlogAPI.Core.Services;
44
using CS321_W5D2_BlogAPI.Infrastructure.Data;
5-
using Microsoft.AspNetCore.Authentication.JwtBearer;
5+
using Microsoft.AspNetCore.Authentication.JwtBearer;
66
using Microsoft.AspNetCore.Builder;
77
using Microsoft.AspNetCore.Hosting;
88
using Microsoft.AspNetCore.HttpsPolicy;
9-
using Microsoft.AspNetCore.Identity;
9+
using Microsoft.AspNetCore.Identity;
1010
using Microsoft.AspNetCore.Mvc;
1111
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
1212
using Microsoft.Extensions.Configuration;
1313
using Microsoft.Extensions.DependencyInjection;
14-
using Microsoft.IdentityModel.Tokens;
15-
14+
using Microsoft.IdentityModel.Tokens;
15+
1616
namespace CS321_W5D2_BlogAPI
1717
{
1818
public class Startup
@@ -35,13 +35,13 @@ public void ConfigureServices(IServiceCollection services)
3535
configuration.RootPath = "ClientApp/build";
3636
});
3737

38-
services.AddHttpContextAccessor();
39-
40-
// TODO: add your DbContext
41-
42-
// TODO: add identity services
43-
44-
// TODO: add JWT support
38+
services.AddHttpContextAccessor();
39+
40+
// TODO: add your DbContext
41+
42+
// TODO: add identity services
43+
44+
// TODO: add JWT support
4545

4646

4747
services.AddScoped<IUserService, UserService>();
@@ -76,11 +76,12 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env /*, DbIni
7676

7777
app.UseAuthentication();
7878

79-
app.UseMvc(routes =>
79+
app.UseRouting();
80+
app.UseEndpoints(routes =>
8081
{
81-
routes.MapRoute(
82+
routes.MapControllerRoute(
8283
name: "default",
83-
template: "{controller}/{action=Index}/{id?}");
84+
pattern: "{controller}/{action=Index}/{id?}");
8485
});
8586

8687
app.UseSpa(spa =>

0 commit comments

Comments
 (0)