public async Task Invoke(HttpContext httpContext, IServiceSingleton serviceSingleton, ILogger <MyMiddleware> logger) { //logger.LogWarning("Invoke from my middleware 1."); await _next(httpContext); serviceSingleton.Go(2); //logger.LogWarning("Invoke from my middleware 2."); }
public async Task Invoke(HttpContext httpContext, IServiceSingleton serviceSingleton, ILogger <MyMiddleware> logger, IDateData dateData) { await httpContext.Response.WriteAsync("DATE INVOKED :" + dateData.InvokedTime); await _next(httpContext); serviceSingleton.Go(1); }