This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19091|Reply: 0

[.NET Core] I researched it. NET Core

[Copy link]
Posted on 1/25/2019 9:27:22 AM | | |
ASP.NET Core programs require a startup class. By convention, the name of the startup class is "Startup". The Startup class is responsible for configuring the request pipeline to handle all requests from the application. You can specify that you use UseStartup() in the Main method <TStartup>to name it. The startup class must contain the Configure method. The ConfigureServices method is optional. They are called when the application starts.



1. Configure method

Used to specify how ASP.NET program responds to HTTP requests. It configures the request pipeline to an IApplicationBuilder instance by adding middleware. IApplicationBuilder instances are provided by dependency injection.

Example:

In the default website templates below, some extensions are used to configure pipelines, supporting BrowserLinks, error pages, static files, ASP.NET MVC, and Identity.

2. ConfigureService method

This method is optional, but must be called before the Configure method, as some features are to be added before connecting to the request pipeline. The configuration options are set in this method.






Previous:C# WPF doesn't have a time control
Next:Morning Post | Friday, January 25, 2019
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com