Skip to content

Instantly share code, notes, and snippets.

@joparara
Created August 22, 2025 03:28
Show Gist options
  • Save joparara/cc7d41418bc18ee16b6d28194d1c33c5 to your computer and use it in GitHub Desktop.
Save joparara/cc7d41418bc18ee16b6d28194d1c33c5 to your computer and use it in GitHub Desktop.
πŸ“ ASP.NET Core Quick Reference

πŸ“ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment