Skip to content

Getting started

Mariusz Kerl edited this page Dec 2, 2017 · 3 revisions

Our example will be created in .NET Core 2.0 but that will look same for .NET Framework projects.

Before we will define first subdomain route, let's tell our application that we are using subdomain routes by invoking AddSubdomains() method (what it really does is injection of our SubdomainUrlHelperFactory). Don't forget about it if you don't want to have bad time.

public void ConfigureServices(IServiceCollection services)
{
    services.AddSubdomains();
    services.AddMvc();
}

Use it before AddMvc()

Clone this wiki locally