.NET Core Interview Questions and Answer
What are the difference between ConfigureServices and Configure Method in Startup class ?
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.
Another answer in short cut -
ConfigureService is an optional method used to configure services that are used by our application where as ConfigureMethods defines how the application will respond to each http request.
Another answer only in one line -
ConfigureService - for add services like your classes and interface mapping(DI) Configure - for adding different middleware.
------------------------------------------------------------------------------------------------------------------------------------
What is use of Identity server ?
Identity Server allows you to issue access tokens for APIs. In my experience, I've only seen it used when the application requires custom OAuth 2.0 authentication that cannot be provided by the authentication providers that are supported by ASP.Net Core. If your site is able to use one existing OAuth 2.0 providers, then there is no advantage to setting up and managing your own instance of Identity Server.
------------------------------------------------------------------------------------------------------------------------------------
Session and State Management in ASP.NET CORE ?
Please read this link for complete underStanding:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.1
How to publish your code through directly on Azure and Sql ?
https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-webapp-using-vs?view=aspnetcore-3.1
Comments
Post a Comment