using Microsoft.AspNetCore.Builder;

namespace VCommon.VSwaggerUI.VAspNetCore
{
    public static class SwaggerUiMiddlewareExtensions
    {
        public static void UseSwaggerUiMiddleware(this IApplicationBuilder builder, ISwaggerUiResourceProvider resourceProvider, string basePath = "/swagger")
        {
            SwaggerUiMiddleware.ResourceProvider = resourceProvider;
            SwaggerUiMiddleware.BasePath = basePath;

            builder.UseMiddleware<SwaggerUiMiddleware>();
        }
    }
}