From db097acc3c9d51127e04f0d9cb04abc88f0d785a Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 27 Feb 2024 19:49:42 +0000 Subject: [PATCH] feat: add Blazor to project --- OliverBooth/Pages/Shared/_AdminLayout.cshtml | 2 ++ OliverBooth/Pages/Shared/_Layout.cshtml | 2 ++ OliverBooth/Pages/_Imports.razor | 5 +++++ OliverBooth/Program.cs | 2 ++ 4 files changed, 11 insertions(+) create mode 100644 OliverBooth/Pages/_Imports.razor diff --git a/OliverBooth/Pages/Shared/_AdminLayout.cshtml b/OliverBooth/Pages/Shared/_AdminLayout.cshtml index 635cf59..42bf356 100644 --- a/OliverBooth/Pages/Shared/_AdminLayout.cshtml +++ b/OliverBooth/Pages/Shared/_AdminLayout.cshtml @@ -73,6 +73,7 @@ @await RenderSectionAsync("Styles", required: false) +
@@ -144,6 +145,7 @@ + diff --git a/OliverBooth/Pages/Shared/_Layout.cshtml b/OliverBooth/Pages/Shared/_Layout.cshtml index 7e365a7..997a6cf 100644 --- a/OliverBooth/Pages/Shared/_Layout.cshtml +++ b/OliverBooth/Pages/Shared/_Layout.cshtml @@ -66,6 +66,7 @@ @await RenderSectionAsync("Styles", required: false) +
@@ -151,6 +152,7 @@ + diff --git a/OliverBooth/Pages/_Imports.razor b/OliverBooth/Pages/_Imports.razor new file mode 100644 index 0000000..0a3ecb4 --- /dev/null +++ b/OliverBooth/Pages/_Imports.razor @@ -0,0 +1,5 @@ +@using System.Net.Http +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.JSInterop +@using Microsoft.AspNetCore.Components.Web \ No newline at end of file diff --git a/OliverBooth/Program.cs b/OliverBooth/Program.cs index fa5b93a..bb35bd9 100644 --- a/OliverBooth/Program.cs +++ b/OliverBooth/Program.cs @@ -53,6 +53,7 @@ builder.Services.AddHostedSingleton(); builder.Services.AddHostedSingleton(); builder.Services.AddRazorPages().AddRazorRuntimeCompilation(); builder.Services.AddControllersWithViews(); +builder.Services.AddServerSideBlazor().AddInteractiveServerComponents(); builder.Services.AddRouting(options => options.LowercaseUrls = true); builder.Services.AddReCaptcha(builder.Configuration.GetSection("ReCaptcha")); @@ -78,5 +79,6 @@ app.UseAuthorization(); app.MapControllers(); app.MapRazorPages(); +app.MapBlazorHub(); app.Run();