/// <summary>
        /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
        /// </summary>
        /// <param name="next"></param>
        /// <param name="options"></param>
        public RuntimeInfoMiddleware(
            RequestDelegate next,
            RuntimeInfoPageOptions options,
            ILibraryManager libraryManager,
            IRuntimeEnvironment runtimeEnvironment)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

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

            _next = next;
            _options = options;
            _libraryManager = libraryManager;
            _runtimeEnvironment = runtimeEnvironment;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
        /// </summary>
        /// <param name="next"></param>
        /// <param name="options"></param>
        public RuntimeInfoMiddleware(
            RequestDelegate next,
            RuntimeInfoPageOptions options,
            ILibraryManager libraryManager,
            IRuntimeEnvironment runtimeEnvironment)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

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

            _next               = next;
            _options            = options;
            _libraryManager     = libraryManager;
            _runtimeEnvironment = runtimeEnvironment;
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
 /// </summary>
 /// <param name="next"></param>
 /// <param name="options"></param>
 public RuntimeInfoMiddleware(
     [NotNull] RequestDelegate next,
     [NotNull] RuntimeInfoPageOptions options,
     [NotNull] ILibraryManager libraryManager)
 {
     _next           = next;
     _options        = options;
     _libraryManager = libraryManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
 /// </summary>
 /// <param name="next"></param>
 /// <param name="options"></param>
 public RuntimeInfoMiddleware(
     [NotNull] RequestDelegate next,
     [NotNull] RuntimeInfoPageOptions options,
     [NotNull] ILibraryManager libraryManager,
     [NotNull] IRuntimeEnvironment runtimeEnvironment)
 {
     _next               = next;
     _options            = options;
     _libraryManager     = libraryManager;
     _runtimeEnvironment = runtimeEnvironment;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
 /// </summary>
 /// <param name="next"></param>
 /// <param name="options"></param>
 public RuntimeInfoMiddleware(
     [NotNull] RequestDelegate next,
     [NotNull] RuntimeInfoPageOptions options,
     [NotNull] ILibraryManager libraryManager,
     [NotNull] IRuntimeEnvironment runtimeEnvironment)
 {
     _next = next;
     _options = options;
     _libraryManager = libraryManager;
     _runtimeEnvironment = runtimeEnvironment;
 }
        public static IApplicationBuilder UseRuntimeInfoPage(
            this IApplicationBuilder builder,
            RuntimeInfoPageOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var libraryManager = builder.ApplicationServices.GetService(typeof(ILibraryManager)) as ILibraryManager;
            var runtimeEnvironment = builder.ApplicationServices.GetService(typeof(IRuntimeEnvironment)) as IRuntimeEnvironment;
            return builder.Use(next => new RuntimeInfoMiddleware(next, options, libraryManager, runtimeEnvironment).Invoke);
        }