Ejemplo n.º 1
0
        public SecurityMiddleware(RequestDelegate next, SecurityMiddlewareOption options, ILoggerFactory logger)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _next    = next;
            _options = options;
            _logger  = logger.CreateLogger(nameof(SecurityMiddleware));
        }
Ejemplo n.º 2
0
 public static IApplicationBuilder UseSecurity(this IApplicationBuilder app, SecurityMiddlewareOption options)
 {
     return(app.UseMiddleware <SecurityMiddleware>(options));
 }