/// <summary>
        /// Creates a default web page for new applications.
        /// </summary>
        /// <param name="next"></param>
        /// <param name="options"></param>
        public KylinWebApiMiddleware(RequestDelegate next, KylinWebApiOptions options)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            _options = options;
            _next    = next;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 注入授权
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public static IApplicationBuilder UseKylinWebApi(this IApplicationBuilder builder, KylinWebApiOptions options)
 {
     if (builder == null)
     {
         throw new ArgumentNullException(nameof(builder));
     }
     return(builder.Use(next => new KylinWebApiMiddleware(next, options).Invoke));
 }