Skip to content

Commit 98d9e0d

Browse files
committed
Add sample for .NET 5.
1 parent 51374e2 commit 98d9e0d

File tree

60 files changed

+40994
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+40994
-0
lines changed

DynamicRoleBasedAuthorization.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicAuthorization.Mvc.Ui
2727
EndProject
2828
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleMvcWebAppWithUi", "samples\netcore3.x\SampleMvcWebAppWithUi\SampleMvcWebAppWithUi.csproj", "{803E1492-22FA-4F63-9687-A30902682C15}"
2929
EndProject
30+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net5", "net5", "{85C709D5-793A-4068-9937-4749BCF34267}"
31+
EndProject
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleMvcWebWithUi", "samples\net5\SampleMvcWebWithUi\SampleMvcWebWithUi.csproj", "{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07}"
33+
EndProject
3034
Global
3135
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3236
Debug|Any CPU = Debug|Any CPU
@@ -61,6 +65,10 @@ Global
6165
{803E1492-22FA-4F63-9687-A30902682C15}.Debug|Any CPU.Build.0 = Debug|Any CPU
6266
{803E1492-22FA-4F63-9687-A30902682C15}.Release|Any CPU.ActiveCfg = Release|Any CPU
6367
{803E1492-22FA-4F63-9687-A30902682C15}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07}.Release|Any CPU.Build.0 = Release|Any CPU
6472
EndGlobalSection
6573
GlobalSection(SolutionProperties) = preSolution
6674
HideSolutionNode = FALSE
@@ -75,6 +83,8 @@ Global
7583
{0FC61895-DE38-4526-96EE-C6CB6AA92A3B} = {DF22D7D8-4CE9-4A0E-9D9B-FB5D6D637089}
7684
{4D5C1490-63F8-434A-A730-380AA6441CE9} = {A7EEBB7E-C64D-4475-93D0-872E080A4E03}
7785
{803E1492-22FA-4F63-9687-A30902682C15} = {5FEB9007-1EFA-4814-BC15-DB0370B84E22}
86+
{85C709D5-793A-4068-9937-4749BCF34267} = {BAAF9837-1DB5-4032-AB2A-2901E6EE6EF8}
87+
{8CEDCB64-13BF-4AD1-B7F4-01A8BB42AB07} = {85C709D5-793A-4068-9937-4749BCF34267}
7888
EndGlobalSection
7989
GlobalSection(ExtensibilityGlobals) = postSolution
8090
SolutionGuid = {18C80710-C9E9-488B-9100-1E4BF8B18038}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{
2+
Layout = "/Views/Shared/_Layout.cshtml";
3+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.Extensions.Logging;
3+
using SampleMvcWebWithUi.Models;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Diagnostics;
7+
using System.Linq;
8+
using System.Threading.Tasks;
9+
10+
namespace SampleMvcWebWithUi.Controllers
11+
{
12+
public class HomeController : Controller
13+
{
14+
private readonly ILogger<HomeController> _logger;
15+
16+
public HomeController(ILogger<HomeController> logger)
17+
{
18+
_logger = logger;
19+
}
20+
21+
public IActionResult Index()
22+
{
23+
return View();
24+
}
25+
26+
public IActionResult Privacy()
27+
{
28+
return View();
29+
}
30+
31+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
32+
public IActionResult Error()
33+
{
34+
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
35+
}
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Text;
6+
7+
namespace SampleMvcWebWithUi.Data
8+
{
9+
public class ApplicationDbContext : IdentityDbContext
10+
{
11+
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
12+
: base(options)
13+
{
14+
}
15+
}
16+
}

samples/net5/SampleMvcWebWithUi/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs

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

0 commit comments

Comments
 (0)