public void Add(IMiddleWare <T> middleWare) { MiddleWares.Add(async(s, next) => { await middleWare.DealWith(s, next); }); }
public DelegateMiddleWare Build() { DelegateMiddleWare first = null; while (types.Count > 0) { IMiddleWare mw = Activator.CreateInstance(types.Pop(), first) as IMiddleWare; first = mw.InvokeAsync; } return(first); }
public void UseMiddleWare(IMiddleWare middleWare, IDataSerializer serializer, ILogger logger = null) { _queue = middleWare; _serializer = serializer; _logger = logger; }
public void use(IMiddleWare Ware) { middleWare.Add(Ware); }