Skip to content

Commit 1697638

Browse files
📦 Upgrade to .NET 7
1 parent 18efaa2 commit 1697638

29 files changed

+153
-112
lines changed

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,3 @@ $RECYCLE.BIN/
448448
## Visual Studio Code
449449
##
450450
.vscode/*
451-
!.vscode/settings.json
452-
!.vscode/tasks.json
453-
!.vscode/launch.json
454-
!.vscode/extensions.json
455-
/deploy/main.parameters.json

RapidBlazor.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata>
44

55
<id>JasonTaylorDev.RapidBlazor</id>
6-
<version>0.9.3</version>
6+
<version>7.0.0</version>
77
<title>Rapid Blazor Template</title>
88
<authors>JasonTaylorDev</authors>
99
<description>Rapid Blazor Template for .NET.</description>

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "6.0.402"
3+
"version": "7.0.100-rc.2.22477.23"
44
}
55
}

setup.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function CreateWorkloadIdentity {
2626
# Create Azure AD Application Registration
2727
$applicationRegistrationDetails=$(az ad app create --display-name "$ProjectName$environmentName") | ConvertFrom-Json
2828

29-
# Create Federated Credential for ...
29+
# Create federated credentials
3030
$credential = @{
3131
name="$ProjectName$environmentName";
3232
issuer="https://token.actions.githubusercontent.com";
@@ -36,7 +36,6 @@ function CreateWorkloadIdentity {
3636

3737
$credential | az ad app federated-credential create --id $applicationRegistrationDetails.id --parameters "@-" | Out-Null
3838

39-
# Create Federated Credential for ...
4039
$credential = @{
4140
name="$ProjectName";
4241
issuer="https://token.actions.githubusercontent.com";

src/Application/Application.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<RootNamespace>RapidBlazor.Application</RootNamespace>
@@ -12,10 +12,10 @@
1212
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
1313
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="10.4.0" />
1414
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
16-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
17-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.2" />
18-
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-rc.2.22472.11" />
16+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-rc.2.22472.3" />
17+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-rc.2.22472.3" />
18+
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

src/Domain/Domain.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<RootNamespace>RapidBlazor.Domain</RootNamespace>
+9-9
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>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<RootNamespace>RapidBlazor.Infrastructure</RootNamespace>
@@ -13,13 +13,13 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.9" />
17-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.9" />
18-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.9" />
19-
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.9" />
20-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
21-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9" />
22-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9" />
16+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.0-rc.2.22476.2" />
17+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0-rc.2.22476.2" />
18+
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.0-rc.2.22476.2" />
19+
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.0-rc.2.22476.2" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-rc.2.22472.11" />
21+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-rc.2.22472.11" />
22+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-rc.2.22472.11" />
2323
</ItemGroup>
2424

2525
</Project>

src/WebUI/Client/Client.csproj

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<RootNamespace>RapidBlazor.WebUI.Client</RootNamespace>
8-
<AssemblyName>RapidBlazor.WebUI.Client</AssemblyName>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>RapidBlazor.WebUI.Client</RootNamespace>
8+
<AssemblyName>RapidBlazor.WebUI.Client</AssemblyName>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<PackageReference Include="Blazored.FluentValidation" Version="2.0.3" />
13-
<PackageReference Include="FluentValidation" Version="10.4.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.9" />
15-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.9" PrivateAssets="all" />
16-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.9" />
17-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
18-
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
19-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
20-
<PackageReference Include="Scrutor" Version="4.2.0" />
21-
</ItemGroup>
11+
<ItemGroup>
12+
<PackageReference Include="Blazored.FluentValidation" Version="2.0.3" />
13+
<PackageReference Include="FluentValidation" Version="10.4.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-rc.2.22476.2" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-rc.2.22476.2" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.0-rc.2.22476.2" />
17+
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0-rc.2.22472.3" />
18+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
19+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
20+
<PackageReference Include="Scrutor" Version="4.2.0" />
21+
</ItemGroup>
2222

23-
<ItemGroup>
24-
<ProjectReference Include="..\Shared\Shared.csproj" />
25-
</ItemGroup>
23+
<ItemGroup>
24+
<ProjectReference Include="..\Shared\Shared.csproj" />
25+
</ItemGroup>
2626

2727
</Project>

src/WebUI/Client/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
builder.RootComponents.Add<App>("#app");
1212
builder.RootComponents.Add<HeadOutlet>("head::after");
1313

14-
builder.Services.AddHttpClient("CleanArchitecture.WebUI.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
14+
builder.Services.AddHttpClient("RapidBlazor.WebUI.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
1515
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
1616

1717
// Supply HttpClient instances that include access tokens when making requests to the server project
18-
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("CleanArchitecture.WebUI.ServerAPI"));
18+
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("RapidBlazor.WebUI.ServerAPI"));
1919

2020
builder.Services
2121
.AddApiAuthorization()

src/WebUI/Client/Properties/launchSettings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:7569",
6+
"applicationUrl": "http://localhost:5246",
77
"sslPort": 44376
88
}
99
},
1010
"profiles": {
11-
"RapidBlazor.WebUI": {
11+
"https": {
1212
"commandName": "Project",
1313
"dotnetRunMessages": true,
1414
"launchBrowser": true,
1515
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16-
"applicationUrl": "https://localhost:7068;http://localhost:5096",
16+
"applicationUrl": "https://localhost:7124;http://localhost:5083",
1717
"environmentVariables": {
1818
"ASPNETCORE_ENVIRONMENT": "Development"
1919
}
+3-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
@using Microsoft.AspNetCore.Components.Authorization
22
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
3-
43
@inject NavigationManager Navigation
5-
@inject SignOutSessionStateManager SignOutManager
64

75
<AuthorizeView>
86
<Authorized>
97
<a href="authentication/profile">Hello, @context.User.Identity?.Name!</a>
10-
<button class="nav-link btn btn-link" @onclick="BeginSignOut">Log out</button>
8+
<button class="nav-link btn btn-link" @onclick="BeginLogOut">Log out</button>
119
</Authorized>
1210
<NotAuthorized>
1311
<a href="authentication/register">Register</a>
@@ -16,9 +14,8 @@
1614
</AuthorizeView>
1715

1816
@code{
19-
private async Task BeginSignOut(MouseEventArgs args)
17+
private void BeginLogOut()
2018
{
21-
await SignOutManager.SetSignOutState();
22-
Navigation.NavigateTo("authentication/logout");
19+
Navigation.NavigateToLogout("authentication/logout");
2320
}
2421
}

src/WebUI/Client/Shared/NavMenu.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88
</div>
99

10-
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
10+
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
1111
<nav class="flex-column">
1212
<div class="nav-item px-3">
1313
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">

src/WebUI/Client/Shared/NavMenu.razor.css

+6
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@
5959
/* Never collapse the sidebar for wide screens */
6060
display: block;
6161
}
62+
63+
.nav-scrollable {
64+
/* Allow sidebar to scroll for tall menus */
65+
height: calc(100vh - 3.5rem);
66+
overflow-y: auto;
67+
}
6268
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
@inject NavigationManager Navigation
1+
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
2+
@inject NavigationManager Navigation
23

34
@code {
45
protected override void OnInitialized()
56
{
6-
Navigation.NavigateTo($"authentication/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}");
7+
Navigation.NavigateToLogin("authentication/login");
78
}
89
}

src/WebUI/Client/Shared/SurveyPrompt.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<span class="text-nowrap">
66
Please take our
7-
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2148851">brief survey</a>
7+
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2186157">brief survey</a>
88
</span>
99
and tell us what you think.
1010
</div>

src/WebUI/Client/wwwroot/css/app.css

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
1+
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
22

33
html, body {
44
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
@@ -18,6 +18,10 @@ a, .btn-link {
1818
border-color: #1861ac;
1919
}
2020

21+
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
22+
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
23+
}
24+
2125
.content {
2226
padding-top: 1.1rem;
2327
}
@@ -62,3 +66,36 @@ a, .btn-link {
6266
.blazor-error-boundary::after {
6367
content: "An error has occurred."
6468
}
69+
70+
.loading-progress {
71+
position: relative;
72+
display: block;
73+
width: 8rem;
74+
height: 8rem;
75+
margin: 20vh auto 1rem auto;
76+
}
77+
78+
.loading-progress circle {
79+
fill: none;
80+
stroke: #e0e0e0;
81+
stroke-width: 0.6rem;
82+
transform-origin: 50% 50%;
83+
transform: rotate(-90deg);
84+
}
85+
86+
.loading-progress circle:last-child {
87+
stroke: #1b6ec2;
88+
stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
89+
transition: stroke-dasharray 0.05s ease-in-out;
90+
}
91+
92+
.loading-progress-text {
93+
position: absolute;
94+
text-align: center;
95+
font-weight: bold;
96+
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
97+
}
98+
99+
.loading-progress-text:after {
100+
content: var(--blazor-load-percentage-text, "Loading");
101+
}

src/WebUI/Client/wwwroot/favicon.ico

-5.3 KB
Binary file not shown.

src/WebUI/Client/wwwroot/index.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88
<base href="/" />
99
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
1010
<link href="css/app.css" rel="stylesheet" />
11+
<link rel="icon" type="image/png" href="favicon.png" />
1112
<link href="RapidBlazor.WebUI.Client.styles.css" rel="stylesheet" />
1213
</head>
1314

1415
<body>
15-
<div id="app">Loading...</div>
16+
<div id="app">
17+
<svg class="loading-progress">
18+
<circle r="40%" cx="50%" cy="50%" />
19+
<circle r="40%" cx="50%" cy="50%" />
20+
</svg>
21+
<div class="loading-progress-text"></div>
22+
</div>
1623

1724
<div id="blazor-error-ui">
1825
An unhandled error has occurred.

src/WebUI/Server/Controllers/OidcConfigurationController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public OidcConfigurationController(IClientRequestParametersProvider clientReques
1717
public IClientRequestParametersProvider ClientRequestParametersProvider { get; }
1818

1919
[HttpGet("_configuration/{clientId}")]
20-
public IActionResult GetClientRequestParameters([FromRoute] string clientId)
20+
public IActionResult GetClientRequestParameters([FromRoute]string clientId)
2121
{
2222
var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId);
2323
return Ok(parameters);

src/WebUI/Server/Pages/Error.cshtml.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using System.Diagnostics;
2+
using Microsoft.AspNetCore.Mvc;
23
using Microsoft.AspNetCore.Mvc.RazorPages;
3-
using System.Diagnostics;
44

55
namespace RapidBlazor.WebUI.Server.Pages;
66

src/WebUI/Server/Program.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Azure.Identity;
1+
using Azure.Identity;
22
using Microsoft.AspNetCore.Authentication;
33
using Microsoft.AspNetCore.Authorization;
44
using NSwag;
@@ -56,7 +56,6 @@
5656
builder.Services.AddSingleton<IAuthorizationPolicyProvider, FlexibleAuthorizationPolicyProvider>();
5757

5858
builder.Services.AddApplicationInsightsTelemetry();
59-
6059
var app = builder.Build();
6160

6261
// Initialise and seed the database

src/WebUI/Server/Properties/launchSettings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:7569",
6+
"applicationUrl": "http://localhost:5246",
77
"sslPort": 44376
88
}
99
},
1010
"profiles": {
11-
"RapidBlazor.WebUI.Server": {
11+
"https": {
1212
"commandName": "Project",
1313
"dotnetRunMessages": true,
1414
"launchBrowser": true,
1515
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16-
"applicationUrl": "https://localhost:7068;http://localhost:5096",
16+
"applicationUrl": "https://localhost:7124;http://localhost:5083",
1717
"environmentVariables": {
1818
"ASPNETCORE_ENVIRONMENT": "Development"
1919
}

0 commit comments

Comments
 (0)