2020-03-24 18:18:25 +01:00
|
|
|
using System;
|
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
2020-03-29 22:35:52 +02:00
|
|
|
using StackExchange.Profiling;
|
2020-03-24 18:18:25 +01:00
|
|
|
using Umbraco.Web.Common.Middleware;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Common.Extensions
|
|
|
|
|
{
|
|
|
|
|
public static class UmbracoRequestApplicationBuilderExtensions
|
|
|
|
|
{
|
|
|
|
|
public static IApplicationBuilder UseUmbracoRequest(this IApplicationBuilder app)
|
|
|
|
|
{
|
|
|
|
|
if (app == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(app));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-03-29 22:35:52 +02:00
|
|
|
app.UseMiddleware<UmbracoRequestMiddleware>();
|
|
|
|
|
app.UseMiddleware<MiniProfilerMiddleware>();
|
2020-03-24 18:18:25 +01:00
|
|
|
return app;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-29 22:35:52 +02:00
|
|
|
|
2020-03-24 18:18:25 +01:00
|
|
|
}
|