ASP.NET Core startup
In the Solution Explorer window, double-click on the Startup.cs
file.
Notice the ConfigureServices
method that adds support for MVC. Later, we will add statements here to add support for the Entity Framework Core:
public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddMvc(); }
Next, we have the Configure
method.
The most important statement here is the one that calls UseMvc
and maps a default route. This route is very flexible, because it would match almost any incoming URL:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseIISPlatformHandler(); app.UseStaticFiles...