Ana içeriğe atla

C# Interview

 Program.cs 

  1. Program.cs file is the entry point of application via Main() method.
  2. it also register Startup.cs class
  3. It also register IISIntegration and create a host using an instance of IWebHostBuilder
Startup File
  1. Configure Service method: it configures services which are required by the app by using Configuration AppServices.it gets called by host before the "Configure" method the configuration app services
  2. Configure Method: It defines the apps request handling pipeline as a series of middleware components by using configure method.
Depency Injection
  1. AddSingleton: Create only one instance when the service is requested for first time. And then the same. instance will be shared  by all different http request.
  2. AddScoped:  Create single instance for each request. For a different http request there will be a different instance.
  3. AddTransient: This instance is not shared at all.Every time a new instance will be created.
What is Middleware?  



What is mean KESTRAL ?  and What is in  process and out of process?
  - In Process
       Pure IIS Hosting - Process  name is w3wp.exe(Only work on IIS)
  - Out of Process
       Process name is dotnet.exe - Two web server ( IIS/Nginx/Apache+Kestrel) - One web server(Kestrel)
  


   

What is Difference  Between Kestrel and IIS
      


Request Delegate
 

  1. Use: This method will execute next middleware method.
  2. Run: Terminates  chain. No other middleware  method will run after this.Should be placed  at the end  at the end of pipeline.
  3. Map: Execute middleware  if path requested by user equal path provided in parameter
Save Configuration Technic
  1. appsettings.json(Default) 
  2. azure key vault
  3. environment variables
  4. in memory  .NET objects
  5. command line arguments
  6. custom providers

What are the various json files avaible in Asp.net Core?

  1. global.json: You can define about level settings  parameter of   your solution. For example you solution name or version etc.
  2. launchsettings.json:  You can define environment setting into this file
  3. appsettings.json:  Application settings is defined. For example Dbconnection string, Email configuration  etc.
  4. bundleconfig.json:  You can define the configuration for bundling and minification for the projcet
  5. project.json:  Asp.net core users Project.JSON file for storing all project level configuration settings.

What is Custom Middleware  and   How can add  in Asp.net Core ?


Types of State Management 
  • Cookies: Data  store in user's  the browser. Browsers send cookies with every request.
  • Session: Session state helps in transferring data between different pages. 
  • TempData: In Asp.net MVC is used to transfer data from controlled to view.
  • Query String: It is used to transfer limited data by appending the url of request.


Explain inheritance is and , and why it's important
Inheritance is one of most important concepts  in object-oriented  programming, together with encapsulation and polymorphism. Inheritance provide to create new class from  that  defined fields in other class. This enable reuseable code and speed up development.

What is LINQ?
LINQ provide us. a consistent query experience to query objects.
 
What  is Garbage Collector
The garbage collector manages allocation and  release of memory for an application. 
What is difference HEAP  and STACK
Heap: Heap is stored reference types
Stack: Stack is stored value types

Yorumlar

Bu blogdaki popüler yayınlar