Foxchat.NET/Foxchat.Chat/Extensions/WebApplicationExtensions.cs

18 lines
471 B
C#
Raw Normal View History

using Foxchat.Chat.Middleware;
namespace Foxchat.Chat.Extensions;
public static class WebApplicationExtensions
{
public static IServiceCollection AddCustomMiddleware(this IServiceCollection services)
{
return services
.AddScoped<AuthenticationMiddleware>();
}
public static IApplicationBuilder UseCustomMiddleware(this IApplicationBuilder app)
{
return app
.UseMiddleware<AuthenticationMiddleware>();
}
}