π ASP.NET Core Quick Reference (Interview Prep) βοΈ Core Basics
Cross-platform, open source, modular
Middleware pipeline: request β middleware β response
Built-in Dependency Injection (DI)
π Project Setup
Program.cs (minimal hosting model, .NET 6+)
Service registration: builder.Services.AddDbContext<>(), AddScoped, etc.
Config: appsettings.json, bind with IOptions
π§© MVC / Razor
MVC pattern: Model = data, Controller = logic, View = UI
Razor syntax: @Model, @if, TagHelpers
Razor Pages = page-focused alternative
πΎ EF Core (Data Access)
DbContext, DbSet
LINQ queries (Where, Select, Include)
Code-first migrations (Add-Migration, Update-Database)
π Web APIs
Routing: [HttpGet], [HttpPost]
Model Binding: [FromBody], [FromQuery]
Validation: [Required], [StringLength]
Return JSON: Ok(), BadRequest(), NotFound()
π Auth & Identity
ASP.NET Identity: users, roles
JWT for APIs (bearer tokens)
Role-based / Policy-based auth
π Middleware & Filters
Middleware: logging, auth, custom logic (next())
Filters: validation, caching, error handling
β‘ Performance / Caching
Response caching middleware
In-memory cache, distributed cache (Redis)
π Deployment & Hosting
Kestrel web server (default)
Reverse proxy: IIS, Nginx, Apache
Containerization: Docker
π Nice-to-Know Extras
SignalR β real-time (chat, notifications)
gRPC β high-performance RPC
Minimal APIs (.NET 6+) β lightweight endpoints
Testing: xUnit, Moq