示例#1
0
        public StreamSystemMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, StreamSystemMiddlewareOptions options, MusicContext MusicContext)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

            this._next        = next;
            this.Logger       = loggerFactory.CreateLogger <StreamSystemMiddleware>();
            this.Options      = options;
            this.MusicContext = MusicContext;
        }
示例#2
0
 public static IApplicationBuilder UseStreamSystemMiddleware(this IApplicationBuilder builder, StreamSystemMiddlewareOptions options)
 {
     return(builder.UseMiddleware <StreamSystemMiddleware>(options));
 }