Beispiel #1
0
 public static IModuleHostingOptions BuildWebHostCallback(this IModuleHostingOptions options, Func <IWebHostBuilder, IWebHost> buildDelegate)
 {
     if (!options.Properties.ContainsKey("BuildWebHostAction"))
     {
         options.Properties.Add("BuildWebHostAction", buildDelegate);
     }
     return(options);
 }
Beispiel #2
0
 public static IModuleHostingOptions Configure(this IModuleHostingOptions options, Action <IWebHostBuilder> configure)
 {
     if (!options.Properties.ContainsKey("ConfigureWebHostAction"))
     {
         options.Properties.Add("ConfigureWebHostAction", configure);
     }
     return(options);
 }
Beispiel #3
0
        internal static IWebHost BuildWebHost(this IModuleHostingOptions options, IWebHostBuilder builder)
        {
            if (!options.Properties.ContainsKey("BuildWebHostAction"))
            {
                return(builder.Build());
            }

            var buildDelegate = (Func <IWebHostBuilder, IWebHost>)options.Properties["BuildWebHostAction"];

            return(buildDelegate(builder));
        }
Beispiel #4
0
        internal static IModuleHostingOptions ConfigureWebHostBuilder(this IModuleHostingOptions options, IWebHostBuilder builder)
        {
            if (!options.Properties.ContainsKey("ConfigureWebHostAction"))
            {
                return(options);
            }

            var configureDelegate = (Action <IWebHostBuilder>)options.Properties["ConfigureWebHostAction"];

            configureDelegate?.Invoke(builder);

            return(options);
        }
Beispiel #5
0
 protected override void ConfigureModule(IModuleHostingOptions options) => _configureModule(options);
Beispiel #6
0
 /// <summary>
 /// Gives a fixture an opportunity to configure the module.
 /// </summary>
 /// <param name="builder">The <see cref="IWebHostBuilder"/> for the application.</param>
 protected virtual void ConfigureModule(IModuleHostingOptions options)
 {
 }