Created
April 26, 2021 21:20
-
-
Save manoj-choudhari-git/dc8054b73b5a1bf165f18557b70bb340 to your computer and use it in GitHub Desktop.
Main method for registering Autofac service provider factory with .NET host builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args) | |
.UseServiceProviderFactory(new AutofacServiceProviderFactory()) | |
.Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureWebHostDefaults(webBuilder => | |
{ | |
webBuilder.UseStartup<Startup>(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment