/// <summary> /// Create a new <see cref="AltairMiddleware"/> /// </summary> /// <param name="nextMiddleware">The next middleware</param> /// <param name="hostingEnv">Provides information about the web hosting environment an application is running in</param> /// <param name="loggerFactory">Represents a type used to configure the logging system and create instances of <see cref="ILogger"/> from the registered <see cref="ILoggerProvider"/></param> /// <param name="options">Options to customize middleware</param> public AltairMiddleware(RequestDelegate nextMiddleware, IWebHostEnvironment hostingEnv, ILoggerFactory loggerFactory, GraphQLAltairOptions options) { if (nextMiddleware == null) { throw new ArgumentNullException(nameof(nextMiddleware)); } _options = options ?? throw new ArgumentNullException(nameof(options)); _staticFileMiddleware = CreateStaticFileMiddleware(nextMiddleware, hostingEnv, loggerFactory); }
/// <summary> /// Create a new <see cref="AltairMiddleware"/> /// </summary> /// <param name="nextMiddleware">The next middleware</param> /// <param name="options">Options to customize middleware</param> public AltairMiddleware(RequestDelegate nextMiddleware, GraphQLAltairOptions options) { _nextMiddleware = nextMiddleware ?? throw new ArgumentNullException(nameof(nextMiddleware)); _options = options ?? throw new ArgumentNullException(nameof(options)); }