Skip to content

Commit 23b6dc9

Browse files
authored
Merge pull request #17 from jkmu/Upgrade-to-Net5.0
Upgrade to net5.0
2 parents 010b8e5 + 0a7c6d6 commit 23b6dc9

16 files changed

+49
-172
lines changed

Source/DemoWebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs

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

Source/DemoWebApp/Data/Migrations/ApplicationDbContextModelSnapshot.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
3434
b.HasKey("Id");
3535

3636
b.HasIndex("NormalizedName")
37-
.HasName("RoleNameIndex");
37+
.HasDatabaseName("RoleNameIndex");
3838

3939
b.ToTable("AspNetRoles");
4040
});
@@ -165,11 +165,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
165165
b.HasKey("Id");
166166

167167
b.HasIndex("NormalizedEmail")
168-
.HasName("EmailIndex");
168+
.HasDatabaseName("EmailIndex");
169169

170170
b.HasIndex("NormalizedUserName")
171171
.IsUnique()
172-
.HasName("UserNameIndex");
172+
.HasDatabaseName("UserNameIndex");
173173

174174
b.ToTable("AspNetUsers");
175175
});

Source/DemoWebApp/DemoWebApp.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<UserSecretsId>aspnet-DemoWebApp-C260B8F3-E5A3-4A4D-B57A-771F079933AA</UserSecretsId>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.2" />
10-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.2" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.2" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2" PrivateAssets="All" />
13-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.1" PrivateAssets="All" />
9+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.6" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.6" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.6" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.6" PrivateAssets="All" />
13+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" PrivateAssets="All" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

Source/DemoWebApp/Views/Home/About.cshtml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Source/DemoWebApp/Views/Home/Contact.cshtml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 18 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,24 @@
1-
@{
1+
@using System.Security.Claims
2+
@{
23
ViewData["Title"] = "Home Page";
34
}
45

5-
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
6-
<ol class="carousel-indicators">
7-
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
8-
<li data-target="#myCarousel" data-slide-to="1"></li>
9-
<li data-target="#myCarousel" data-slide-to="2"></li>
10-
<li data-target="#myCarousel" data-slide-to="3"></li>
11-
</ol>
12-
<div class="carousel-inner" role="listbox">
13-
<div class="item active">
14-
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
15-
<div class="carousel-caption" role="option">
16-
<p>
17-
Learn how to build ASP.NET apps that can run anywhere.
18-
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
19-
Learn More
20-
</a>
21-
</p>
22-
</div>
23-
</div>
24-
<div class="item">
25-
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
26-
<div class="carousel-caption" role="option">
27-
<p>
28-
There are powerful new features in Visual Studio for building modern web apps.
29-
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
30-
Learn More
31-
</a>
32-
</p>
33-
</div>
34-
</div>
35-
<div class="item">
36-
<img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" />
37-
<div class="carousel-caption" role="option">
38-
<p>
39-
Bring in libraries from NuGet and npm, and automate tasks using Grunt or Gulp.
40-
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
41-
Learn More
42-
</a>
43-
</p>
44-
</div>
45-
</div>
46-
<div class="item">
47-
<img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" />
48-
<div class="carousel-caption" role="option">
49-
<p>
50-
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
51-
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
52-
Learn More
53-
</a>
54-
</p>
55-
</div>
56-
</div>
57-
</div>
58-
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
59-
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
60-
<span class="sr-only">Previous</span>
61-
</a>
62-
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
63-
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
64-
<span class="sr-only">Next</span>
65-
</a>
66-
</div>
67-
686
<div class="row">
69-
<div class="col-md-3">
70-
<h2>Application uses</h2>
71-
<ul>
72-
<li>Sample pages using ASP.NET Core MVC</li>
73-
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
74-
</ul>
75-
</div>
76-
<div class="col-md-3">
77-
<h2>How to</h2>
78-
<ul>
79-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
80-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
81-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
82-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
83-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
84-
</ul>
85-
</div>
86-
<div class="col-md-3">
87-
<h2>Overview</h2>
88-
<ul>
89-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
90-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
91-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
92-
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
93-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
94-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
95-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
96-
</ul>
97-
</div>
98-
<div class="col-md-3">
99-
<h2>Run &amp; Deploy</h2>
7+
<hr/>
8+
@if (Context.User.Identities.Any(i => i.IsAuthenticated))
9+
{
10+
<p>User is logged in as <strong>@Context.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name)?.Value</strong></p>
11+
<p>Claims:</p>
10012
<ul>
101-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
102-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
103-
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
13+
@foreach (var claim in Context.User.Claims)
14+
{
15+
<li>@claim.Type: <strong>@claim.Value</strong></li>
16+
}
10417
</ul>
105-
</div>
106-
</div>
18+
}
19+
else
20+
{
21+
<p>User is not logged in</p>
22+
}
23+
24+
</div>

Source/DemoWebApp/Views/Manage/ChangePassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
<h4>@ViewData["Title"]</h4>
8-
@Html.Partial("_StatusMessage", Model.StatusMessage)
8+
@Html.PartialAsync("_StatusMessage", Model.StatusMessage)
99
<div class="row">
1010
<div class="col-md-6">
1111
<form method="post">

Source/DemoWebApp/Views/Manage/ExternalLogins.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ViewData.AddActivePage(ManageNavPages.ExternalLogins);
55
}
66

7-
@Html.Partial("_StatusMessage", Model.StatusMessage)
7+
@Html.PartialAsync("_StatusMessage", Model.StatusMessage)
88
@if (Model.CurrentLogins?.Count > 0)
99
{
1010
<h4>Registered Logins</h4>

Source/DemoWebApp/Views/Manage/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
<h4>@ViewData["Title"]</h4>
8-
@Html.Partial("_StatusMessage", Model.StatusMessage)
8+
@Html.PartialAsync("_StatusMessage", Model.StatusMessage)
99
<div class="row">
1010
<div class="col-md-6">
1111
<form method="post">

Source/DemoWebApp/Views/Manage/SetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
<h4>Set your password</h4>
8-
@Html.Partial("_StatusMessage", Model.StatusMessage)
8+
@Html.PartialAsync("_StatusMessage", Model.StatusMessage)
99
<p class="text-info">
1010
You do not have a local username/password for this site. Add a local
1111
account so you can log in without an external login.

0 commit comments

Comments
 (0)