YaeBlog/YaeBlog.Theme.FluentUI/BlogApplicationBuilderExtensions.cs

31 lines
995 B
C#
Raw Normal View History

2024-01-20 17:10:32 +08:00
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
2024-01-23 12:27:25 +08:00
using Microsoft.FluentUI.AspNetCore.Components;
2024-01-20 17:10:32 +08:00
using YaeBlog.Core.Builder;
using YaeBlog.Core.Extensions;
namespace YaeBlog.Theme.FluentUI;
public static class BlogApplicationBuilderExtensions
{
public static void UseFluentTheme(this BlogApplicationBuilder builder)
{
builder.ConfigureWebApplicationBuilder(ConfigureWebApplicationBuilder);
builder.ConfigureWebApplication(ConfigureWebApplication);
2024-01-20 17:10:32 +08:00
}
private static void ConfigureWebApplicationBuilder(WebApplicationBuilder builder)
{
builder.Services.AddRazorComponents();
2024-01-23 12:27:25 +08:00
builder.Services.AddFluentUIComponents();
2024-01-20 17:10:32 +08:00
}
private static void ConfigureWebApplication(WebApplication application)
{
application.UseStaticFiles();
application.UseAntiforgery();
2024-02-15 21:20:32 +08:00
application.UseStatusCodePagesWithRedirects("~/NotFound");
2024-01-20 17:10:32 +08:00
application.MapRazorComponents<App>();
}
}