Amit Jangid
Difference between ConfigureServices and Configure Method in Startup class ?

What are the difference between ConfigureServices and Configure Method in Startup class ?

By Amit Jangid in .NET Core on May 10 2020
  • aftab ahmad
    Oct, 2020 25

    ConfigureServices method gets call runtime to register services to DI container. After registering the dependent classes, you can use those classes anywhere in the application. The ConfigureServices method includes the IServiceCollection parameter to register services to the DI container

    Configure the method gets call runtime to configure the HTTP request pipeline for application. Configure use the instance of the IApplicationBuilder that is provided by In-Build IOC container. In other words, you add the middleware in this method like routing and other custom middleware as per your application requirements

    • 4
  • kumar Devaraja
    Jul, 2020 3

    ConfigureService is an optional method used to configure services that are used by our application where as ConfigureMethos defines how the application will respond to each http request

    • 1
  • Mohsin Azam
    Aug, 2020 12

    ConfigureService - for add services,your classes and interface mapping(DI) Configure - for adding different middleware

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS