From 417d9cae7e9b67d82a15ce638580b1c90357e3f2 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 | 11 +++++++++++ OliverBooth/Program.cs | 3 +++ 4 files changed, 18 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..aefe217 --- /dev/null +++ b/OliverBooth/Pages/_Imports.razor @@ -0,0 +1,11 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using Microsoft.JSInterop + + \ No newline at end of file diff --git a/OliverBooth/Program.cs b/OliverBooth/Program.cs index fa5b93a..cc0672a 100644 --- a/OliverBooth/Program.cs +++ b/OliverBooth/Program.cs @@ -53,6 +53,8 @@ builder.Services.AddHostedSingleton(); builder.Services.AddHostedSingleton(); builder.Services.AddRazorPages().AddRazorRuntimeCompilation(); builder.Services.AddControllersWithViews(); +builder.Services.AddRazorComponents().AddInteractiveServerComponents(); +builder.Services.AddServerSideBlazor().AddInteractiveServerComponents(); builder.Services.AddRouting(options => options.LowercaseUrls = true); builder.Services.AddReCaptcha(builder.Configuration.GetSection("ReCaptcha")); @@ -78,5 +80,6 @@ app.UseAuthorization(); app.MapControllers(); app.MapRazorPages(); +app.MapBlazorHub(); app.Run();