Пример #1
0
        public static IApplicationBuilder UseApiAuthorized(this IApplicationBuilder builder, ApiAuthorizedOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            
            return builder.UseMiddleware<ApiAuthorizedMiddleware>(Options.Create(options));
        }
        public static IApplicationBuilder UseApiAuthorized(this IApplicationBuilder builder, ApiAuthorizedOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            return(builder.UseMiddleware <ApiAuthorizedMiddleware>(Options.Create(options)));
        }
Пример #3
0
 public ApiAuthorizedMiddleware(RequestDelegate next, IOptions <ApiAuthorizedOptions> options)
 {
     this._next    = next;
     this._options = options.Value;
 }
Пример #4
0
 public ApiAuthorizedMiddleware(RequestDelegate next, IOptions<ApiAuthorizedOptions> options)
 {
     this._next = next;
     this._options = options.Value;
 }