Exploring the ConfigureServices method
Let's compare the current ConfigureServices
method with a previous long-term support version to see what has changed. If you created a new ASP.NET Core project using version 3.1 and open Startup.cs
, you will find the method to configure the services, which looks like this:
public void ConfigureServices(IServiceCollection services) { services.Configure<CookiePolicyOptions>(options => { // This lambda determines whether user // consent for non-essential cookies is // needed for a given request. options.CheckConsentNeeded = context => true; }); services.AddControllersWithViews(); services.AddRazorPages(); }
In contrast...