using System;
using System.Threading.Tasks;
namespace Mhf.Server.Web.Middleware
{
///
/// Implementation of a middleware
///
public class WebMiddlewareStack
{
private WebMiddlewareDelegate _webMiddlewareDelegate;
public WebMiddlewareStack(WebMiddlewareDelegate kernel)
{
_webMiddlewareDelegate = kernel;
}
public Task Start(WebRequest request)
{
return _webMiddlewareDelegate(request);
}
public void Use(Func middleware)
{
_webMiddlewareDelegate = middleware(_webMiddlewareDelegate);
}
}
}