Example #1
0
        // private readonly ILogger<HomeController> _logger;

        public HomeController(IConfiguration config, IFirstDI first, IRedisContext cache, IRegexRule regexRule)
        {
            _config    = config;
            _first     = first;
            _cache     = cache;
            _regexRule = regexRule;
        }
Example #2
0
 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");
     }
 }
Example #4
0
 public async Task Invoke(HttpContext context, IFirstDI first)
 {
     // first.Name = "Changed By Middleware";
     await _next(context);
 }