DOT NET CORE Basic Interview Question and Answers
Q) What is the startup class in ASP.NET core? A) Startup class is the entry point of the ASP.NET Core application. This class contains the application configuration related items. It is not necessary that class name must "Startup", it can be anything, we can configure startup class in Program class. public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<TestClass>(); } ----------------------------------------------------------------------------------------------------------------------------- Q) What is the use of Configure Services method of startup class? A) This is an optional method of startup class. It can be used to configure the services that are used by the application. This method calls first when the application is requested for the first time...
Comments
Post a Comment