public ApiAuthorizedMiddleware(RequestDelegate next, IOptions <ApiAuthorizedOptions> options)
 {
     this.next    = next;
     this.options = options.Value;
 }
        public static IApplicationBuilder UseApiAuthorized(this IApplicationBuilder builder, ApiAuthorizedOptions options)
        {
            Check.NotNull(builder, nameof(builder));
            Check.NotNull(options, nameof(options));

            return(builder.UseMiddleware <ApiAuthorizedMiddleware>(Options.Create(options)));
        }