2017-05-09 18:33:58 +02:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
|
|
|
|
|
2017-07-13 17:35:19 +02:00
|
|
|
|
namespace Basket.API.Infrastructure.Middlewares
|
2017-05-09 18:33:58 +02:00
|
|
|
|
{
|
|
|
|
|
public static class WebHostBuildertExtensions
|
|
|
|
|
{
|
2017-07-13 17:35:19 +02:00
|
|
|
|
public static IWebHostBuilder UseFailing(this IWebHostBuilder builder, Action<FailingOptions> options)
|
2017-05-09 18:33:58 +02:00
|
|
|
|
{
|
|
|
|
|
builder.ConfigureServices(services =>
|
|
|
|
|
{
|
2017-07-13 17:35:19 +02:00
|
|
|
|
services.AddSingleton<IStartupFilter>(new FailingStartupFilter(options));
|
2017-05-09 18:33:58 +02:00
|
|
|
|
});
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|