using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using YaeBlog.Core.Abstractions; using YaeBlog.Core.Processors; using YaeBlog.Core.Services; namespace YaeBlog.Core.Extensions; public static class WebApplicationExtensions { public static void UseYaeBlog(this WebApplication application) { application.UsePostRenderProcessor(); application.UsePostRenderProcessor(); application.UsePostRenderProcessor(); application.UsePostRenderProcessor(); } private static void UsePreRenderProcessor(this WebApplication application) where T : IPreRenderProcessor { RendererService rendererService = application.Services.GetRequiredService(); T preRenderProcessor = application.Services.GetRequiredService(); rendererService.AddPreRenderProcessor(preRenderProcessor); } private static void UsePostRenderProcessor(this WebApplication application) where T : IPostRenderProcessor { RendererService rendererService = application.Services.GetRequiredService(); T postRenderProcessor = application.Services.GetRequiredService(); rendererService.AddPostRenderProcessor(postRenderProcessor); } }