dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

Multitenant Hosting Support Library #66

Open dazinator opened 4 years ago

dazinator commented 4 years ago

In terms of how a typical asp.net core app starts up, it typically uses something like this:

public class Program
{
    public static void Main(string[] args)
    {
        CreateHostBuilder(args).Build().Run();
    }

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            });
}

Note that this uses a single startup class to configure services and middleware for the entire application.

Could dotnettency offer a support library to improve this for multitenancy? I.e perhaps allowing you to implement your per tenant startup in a seperate class to the application startup class?

Think about this.

dazinator commented 4 years ago

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-3.1