// private readonly ILogger<HomeController> _logger; public HomeController(IConfiguration config, IFirstDI first, IRedisContext cache, IRegexRule regexRule) { _config = config; _first = first; _cache = cache; _regexRule = regexRule; }
public async Task Invoke(HttpContext context, IFirstDI first) { context.Response.Headers.Add(Header, HeaderValue); if (!string.IsNullOrEmpty(_options.FrameAncestors.XFrame)) { context.Response.Headers.Add("X-Frame-Options", _options.FrameAncestors.XFrame); } await _next(context); }
public async Task Invoke(HttpContext context, IFirstDI first) { // first.Name = "Changed By Middleware"; try { await _next(context); } catch (Exception ex) { _logger.LogCritical(ex, "Error"); } }
public async Task Invoke(HttpContext context, IFirstDI first) { // first.Name = "Changed By Middleware"; await _next(context); }