SOOPRO Pathshala provides ASP.NET Core Interview Questions and Answers
ASP.NET Core is a modern, open-source web framework for building cross-platform web apps and APIs.
It's lightweight, modular, and runs on Windows, Linux, and macOS.
Key differences between ASP.NET Core and ASP.NET
Application of ASP.NET can run on Windows only.
Application of ASP.NET Core can run on any OS.
Framework of ASP.NET is larger and more complex
Framework of ASP.NET Core is modular and lightweight.
ASP.NET is potentially slower due to larger size
ASP.NET Core is faster and more efficient.
Cross-platform: Develop for Windows, macOS, Linux, & various architectures.
Lightweight & performant: Blazing fast execution & minimal resource footprint.
Unified APIs: Build web UIs & APIs with a consistent, flexible approach.
Modular & testable: Easy to customize & test, promoting code maintainability.
Cloud-friendly: Integrates seamlessly with cloud platforms like Azure.
Blazingly fast: Optimized for modern web frameworks & APIs.
Open-source & community-driven: Access to vast resources & ongoing development.
The ASP.NET Core request processing pipeline, also called the "middleware pipeline," is a series of modular components called "middleware" that handle an incoming HTTP request in sequence.
Each middleware performs a specific task before passing the request to the next one, like authentication, logging, or routing.
In ASP.NET Core, a Request delegate is a function that processes and handles an incoming HTTP request.
In ASP.NET Core, the Host plays a crucial role in managing the application's lifecycle and providing resources for its execution.
Responsibilities of the Host are:
Configuration: Reads and parses application settings and environment variables.
Dependency Injection (DI): Creates and manages the lifetime of dependencies needed by your application.
Logging: Configures and manages logging infrastructure for your application.
Lifetime Management: Starts, runs, and stops your application gracefully.
Hosting Environment: Provides information about the environment your application runs in (e.g., development, production).
Web Server Integration: Manages the web server (e.g., Kestrel) used to serve your application.
Hosted Services: Enables background tasks to run alongside your application.
ID is unique. A particular ID can be only assigned to a single element.
Class are not unique and multiple elements can have the same class.
In ASP.NET Core, middleware refers to a powerful and flexible concept for processing incoming HTTP requests and generating responses.
It essentially acts like a pipeline of components, where each component performs a specific task on the request or response before passing it to the next one.
Middleware is essentially software code that gets plugged into the ASP.NET Core application pipeline.
Each middleware component is a class that implements the IMiddleware interface.
Each component gets executed sequentially on every HTTP request and response.
A Change Token in ASP.NET Core is a lightweight, efficient mechanism for detecting changes to a resource or piece of data.
It's like a mini-observer that sits on your data and silently waits for any modifications.
When something changes, the token raises an event, notifying you to take appropriate action.
Accessing ASP.NET Core APIs from a class library involves two key steps:
1. Target the ASP.NET Core Shared Framework: This ensures your library shares the same base framework as an ASP.NET Core application, allowing seamless API usage.
Reference relevant NuGet packages: For specific ASP.NET Core functionalities, install the corresponding NuGet packages within your class library project. This grants access to specific API components you need.