using Microsoft.AspNetCore.Builder;

namespace e_suite.Service.Performance.Extensions.Web;

/// <summary>
/// Adds the Performance Moniotr to the Pipeline
/// Don`t Forget : to capcher ActionParameters the PerformanceActionParamMaperFilter must be added to the Filter pipeline
/// Note: When using try to add this delegate to the end of the pipline preferably right before the rauting delegate to get a more precise measurement
/// </summary>
public static class PerformanceMiddlewareExtensions
{
    public static IApplicationBuilder AddPerformanceMonitor(this IApplicationBuilder builder)
    {
        return builder.UseMiddleware<PerformanceMonitorMiddleware>();
    }
}