Frameworks
Build back ends with C# and ASP.NET Core: EF Core, DI, caching, testing, messaging and deployment.
A path for developers building web APIs and services on .NET. It starts with C# and general backend skills, covers the ASP.NET Core framework, EF Core and dependency injection, then the wider ecosystem: databases, caching, logging, API styles, real-time, background jobs, testing, microservices and CI/CD. Each subject links the official Microsoft docs or the library's own documentation.
The subjects follow the roadmap.sh ASP.NET Core roadmap.
ASP.NET Core apps are written in C# on the .NET runtime. Get comfortable with the type system, LINQ, async/await and nullable reference types before the framework, and learn the dotnet tooling you will use every day.
A statically typed, object-oriented language with records, pattern matching, generics, LINQ and first-class async. Turn on <Nullable>enable</Nullable> so the compiler warns about possible nulls.
The cross-platform runtime and base class library. Even-numbered releases are LTS with three years of support; odd ones get shorter standard support.
dotnet new, build, run, test, add package and publish drive the whole lifecycle; dotnet watch reloads on save during development.
Analyzer rules for naming, ordering, spacing and documentation, enforced at build time via StyleCop.Analyzers and tuned in .editorconfig so the whole team writes consistent code.
The foundations any backend developer needs regardless of stack: version control, a hosting platform for collaboration, a solid grasp of HTTP, and the data structures and algorithms behind efficient code.
Commit, branch, merge, rebase and resolve conflicts. Add a .NET .gitignore so bin/ and obj/ never get committed.
Hosted Git with pull or merge requests, code review, issues and built-in CI. The workflow matters more than which one you pick.
Methods, status codes, headers, caching and cookies, plus TLS for HTTPS. ASP.NET Core supports HTTP/1.1, HTTP/2 and HTTP/3 through Kestrel.
Know when to use List<T>, Dictionary<TKey,TValue>, HashSet<T> or Queue<T>, and the Big-O cost of searching, sorting and lookups.
Most ASP.NET Core apps sit on a relational database. Even with an ORM you need to write and read SQL, design normalised schemas, and know which logic belongs in the database.
SELECT with joins, filtering, grouping and aggregates, plus INSERT, UPDATE and DELETE. Read the SQL your ORM generates to catch inefficient queries.
Entities, primary and foreign keys, normalisation to third normal form and when to denormalise for reads. Index the columns you filter and join on.
Named SQL routines stored in the database. Useful for heavy set-based work; EF Core can call them with FromSql or ExecuteSql.
NOT NULL, UNIQUE, CHECK, primary and foreign keys enforce integrity in the database itself, so a bug in one service cannot corrupt data.
Code the database runs automatically on insert, update or delete, often for auditing. Hidden side effects make them hard to debug, so use sparingly.
The framework itself: a WebApplication host built in Program.cs, a middleware pipeline, routing to endpoints, configuration and logging. Choose the app model (MVC, Razor Pages, Minimal APIs, Blazor) that fits the job.
Controllers handle requests, models carry data and views render HTML; [ApiController] controllers return JSON with automatic model validation responses.
Page-focused server-rendered UI where each .cshtml page has its own PageModel with handlers like OnGet and OnPost. Simpler than MVC for form-heavy sites.
Reusable .razor UI components with parameters and events; the building blocks of Blazor, renderable statically on the server or interactively.
Map endpoints straight to lambdas with app.MapGet and friends; use route groups and endpoint filters to organise them. Less ceremony and slightly faster than controllers.
Components in the request pipeline that run in registration order, such as exception handling, HTTPS redirection, routing, auth and CORS. Order mistakes are a common source of bugs.
MVC filters (authorization, resource, action, exception, result) run around controller actions and are applied via attributes; minimal APIs use endpoint filters instead.
Configuration merges appsettings.json, per-environment files, environment variables, user secrets and command-line args. Bind sections to typed classes with the options pattern.
ORMs map tables to C# classes so you query with LINQ instead of strings. EF Core is the default; micro-ORMs trade features for raw speed and full control over SQL.
Microsoft's ORM with LINQ queries, change tracking, migrations and providers for SQL Server, PostgreSQL, SQLite and more.
A DbContext with DbSet<T> properties, configured by conventions, data annotations or the fluent API in OnModelCreating, and registered with AddDbContext.
Define the model in C#, then dotnet ef migrations add and database update evolve the schema. Review generated migrations, and prefer SQL scripts or bundles in production.
Tracks loaded entities and their state so SaveChanges knows what to write. Use AsNoTracking() for read-only queries to save memory and time.
Eager loading with Include fetches related data up front; explicit loading fetches on demand; lazy loading uses proxies and easily causes N+1 queries.
A micro-ORM that maps results of hand-written SQL to objects via extension methods on IDbConnection. Very fast; no change tracking or migrations.
A hybrid ORM offering both raw-SQL and fluent operations, with batch and bulk operations and second-layer caching.
A mature port of Java's Hibernate with rich mapping options; mostly seen in older enterprise codebases.
ASP.NET Core is built around a DI container: register services in builder.Services and receive them through constructor parameters. It keeps classes testable and swaps implementations without touching callers.
Each registration has a lifetime that decides how long an instance lives. Getting it wrong causes stale data, thread-safety bugs or captive dependencies, which the container flags when scope validation is on.
One instance per request (per scope). The right choice for DbContext and anything holding per-request state.
A new instance every time it is resolved. Good for lightweight stateless services; avoid for expensive or disposable objects.
One instance for the app's lifetime, so it must be thread-safe. Never inject a scoped service into a singleton.
The built-in container covers most needs. Third-party containers or extensions add assembly scanning, decorators and modules when the registration code grows large.
Microsoft.Extensions.DependencyInjection is the default container, with keyed services since .NET 8. Fast and enough for most apps.
A feature-rich container with modules, property injection, decorators and assembly scanning; plugs into ASP.NET Core via UseServiceProviderFactory.
Extensions for the built-in container that add assembly scanning (Scan) and decoration (Decorate) without switching containers.
Caching avoids repeating expensive work such as database queries or HTTP calls. Decide what is safe to serve stale, set expirations, and plan invalidation; .NET 9 adds HybridCache, combining memory and distributed tiers with stampede protection.
IMemoryCache stores objects in the process. Fastest option, but each server has its own copy and it is lost on restart.
IDistributedCache stores byte arrays in an external store shared by every instance, so cached data survives restarts and stays consistent across servers.
An in-memory data store and the usual distributed cache backend, added with AddStackExchangeRedisCache; also handy for pub/sub and rate limiting.
A simple, fast key-value cache without persistence or rich data types. Less common in .NET than Redis.
An EF Core interceptor library that caches query results and invalidates them when related tables change, saving round-trips for repeated queries.
Beyond fundamentals, pick concrete engines: a relational database as the system of record, with NoSQL stores, cloud databases or search engines added only for needs it handles badly.
Full-text search engines index documents for relevance-ranked search, facets, fuzzy matching and autocomplete, which plain SQL LIKE queries cannot do well. Keep the database as the source of truth and sync into the index.
A distributed search and analytics engine built on Lucene, used from .NET via the official Elastic.Clients.Elasticsearch client.
Apache's Lucene-based search server with a mature feature set, typically reached from .NET through SolrNet.
A lightweight full-text search server that indexes SQL databases and is queried with an SQL-like language.
Managed cloud databases remove patching, backups and scaling from your plate, at the cost of vendor lock-in and per-request pricing you must design around.
Azure's globally distributed multi-model database with tunable consistency levels; usable from EF Core via its Cosmos provider. Partition key choice drives cost and performance.
AWS's serverless key-value and document database with single-digit-millisecond reads. Model data around access patterns, not normalised tables.
Relational engines with mature EF Core providers. SQL Server is the traditional .NET pairing; PostgreSQL is a popular open-source alternative with excellent tooling.
Microsoft's database with first-class EF Core support, SQL Server Management Studio, and Azure SQL as its managed cloud form.
Open-source, standards-focused and feature-rich (JSONB, arrays, full-text search). Use it from .NET via Npgsql and its EF Core provider.
A community fork of MySQL, mostly compatible with it; the Pomelo provider supports it in EF Core.
A widely hosted open-source database; reach it from EF Core through the Pomelo or Oracle providers.
Non-relational stores built for flexible schemas, huge write volumes or embedded use. Choose by access pattern and consistency needs, not by fashion.
A document database storing BSON documents, accessed via the official C# driver or its EF Core provider. Strong for nested, evolving data.
A wide-column store for very high write throughput across data centres; tables are designed per query.
An embedded, serverless NoSQL database in a single file and a single DLL, good for desktop apps, tests and small tools.
A JSON document database with an HTTP API and multi-master replication, suited to offline-first sync.
ASP.NET Core logs through ILogger<T>; a logging library behind it adds structured output, enrichment and sinks such as files, Seq or OpenTelemetry. Log with message templates, not string interpolation, so fields stay queryable.
Structured logging with a large ecosystem of sinks and enrichers; plug it in with Serilog.AspNetCore and UseSerilogRequestLogging for compact request logs.
A long-standing logging library configured in XML or code, with many targets and good performance; integrates with ILogger via NLog.Web.AspNetCore.
How your service talks to clients and other services: REST over HTTP is the default, GraphQL suits flexible client-driven queries, and gRPC gives fast, typed service-to-service calls. Call outbound APIs through IHttpClientFactory.
Contract-first RPC over HTTP/2 with Protocol Buffers and generated clients; supports streaming. Browsers need gRPC-Web or JSON transcoding.
Resource-oriented APIs over HTTP with proper methods, status codes and problem-details errors. Document them with OpenAPI, built in since .NET 9 via Microsoft.AspNetCore.OpenApi.
Turns query strings like ?filter=age>30&orderBy=name into LINQ, adding filtering, sorting and paging to list endpoints with little code.
A standard for queryable REST APIs with $filter, $select, $expand and paging, implemented by Microsoft.AspNetCore.OData. Powerful, but exposes a lot of query surface.
A typed query language where clients request exactly the fields they need from one endpoint. Useful for varied front ends; watch for N+1 queries (use data loaders) and limit query depth and cost.
The most popular .NET GraphQL server, with code-first schemas, data loaders, filtering and projections that translate to EF Core queries.
An older GraphQL implementation for .NET with schema-first and code-first styles.
Push updates to clients without polling, for chat, notifications and live dashboards. Plan for scaling out, since connections are tied to a server instance.
A persistent full-duplex connection over a single TCP socket. ASP.NET Core exposes it via UseWebSockets and AcceptWebSocketAsync, leaving framing and reconnects to you.
A higher-level library with hubs, groups and automatic transport fallback. Scale out with a Redis backplane or Azure SignalR Service.
Converting between entities and DTOs keeps your database model out of your API contract. Pick between hand-written mappings, source generators and reflection-based libraries based on how much hidden magic you can tolerate.
Plain constructors, extension methods or LINQ Select projections. Explicit, fast, refactor-safe and easy to debug; usually enough.
Convention-based mapping configured with profiles. Saves typing but hides mistakes until runtime; it moved to a commercial licence for larger companies in 2025.
A source generator that writes mapping code at compile time, so it is as fast as hand-written code and mismatches show up as build warnings.
Background work that should not block requests: queues, recurring jobs and long-running processing. Decide whether jobs must survive restarts and run only once across multiple instances.
Derive from BackgroundService and register with AddHostedService. Simple and dependency-free, but jobs are in-memory and lost on restart; create a scope to use scoped services.
Persistent fire-and-forget, delayed and recurring jobs stored in SQL Server, Redis or others, with retries and a built-in dashboard.
Quartz.NET is a full scheduler with cron triggers, calendars, clustering and persistent job stores.
A lightweight, fluent library for scheduling, queuing, caching and events with almost no configuration; in-memory only.
A layered test suite: many fast unit tests, integration tests that boot the app against real dependencies, and a few end-to-end tests through the UI. Run them all in CI on every pull request with dotnet test.
Test runners and attribute models for .NET. All three integrate with dotnet test and IDEs; pick one per solution.
The most common choice for new projects: [Fact] and [Theory] tests, a new class instance per test, and fixtures for shared setup.
A long-established framework with [Test], [TestCase], setup/teardown attributes and a constraint-based assertion model.
Microsoft's framework with [TestClass] and [TestMethod], tightly integrated with Visual Studio.
Fluent assertion libraries read like sentences and produce failure messages that explain what went wrong, making failing tests faster to diagnose than the frameworks' built-in asserts.
Assertions like result.ShouldBe(42) whose failure messages include the variable name and expected versus actual values.
Replace dependencies with test doubles so a unit test exercises one class. Mock at interface boundaries and avoid mocking types you do not own, like DbContext.
Lambda-based setups and verifications (mock.Setup(x => x.Get(1)).Returns(item)); the most widely used .NET mocking library.
A terse syntax where substitutes are configured by calling them: calc.Add(1, 2).Returns(3). Popular for readability.
Fakes created with A.Fake<T>() and configured with A.CallTo(...), designed to be discoverable for newcomers.
Generate test data instead of hand-writing it, so tests focus on what matters and edge cases surface naturally. Seed generators for reproducible runs.
Creates fully populated anonymous objects for the arrange phase, and combines with xUnit via [AutoData] and with mocking libraries for auto-mocking.
Realistic fake names, addresses, emails and more via Faker<T> rules; handy for seeding databases and demos too.
Run the real app in-process against real infrastructure to verify routing, DI, middleware and database behaviour together. Slower than unit tests but catches configuration and query bugs they miss.
Boots your app in memory with a TestServer and an HttpClient; override services in ConfigureWebHost to swap dependencies for tests.
Starts throwaway Docker containers (SQL Server, PostgreSQL, Redis, RabbitMQ) from test code, so integration tests run against the real engine.
Resets a test database between tests by deleting data in foreign-key order, far faster than recreating the schema.
Drive a real browser through complete user flows against a deployed or locally running app. Keep the suite small and focused on critical paths, since these tests are slow and brittle.
Cross-browser automation with auto-waiting and tracing, with a first-class .NET API that runs under NUnit, MSTest or xUnit.
Automates Chrome and Firefox via DevTools protocols; PuppeteerSharp brings it to .NET.
A JavaScript E2E framework running in the browser with time-travel debugging; tests are written in JS or TS, separate from your .NET code.
Behaviour-driven development writes scenarios in plain language that business people can read, then binds each step to test code. Worth it when stakeholders actually read the scenarios.
The open-source successor to SpecFlow: Gherkin .feature files with Given/When/Then steps bound to C# methods, running on xUnit, NUnit or MSTest.
BDD scenarios written directly in C# without feature files, keeping refactoring tools working, with readable reports generated from method names.
Splitting a system into independently deployable services buys team autonomy and independent scaling, at the price of network failures, eventual consistency and much heavier operations. Start with a modular monolith and split only where it pays off.
Brokers decouple services in time: producers publish messages and consumers process them when ready. Design for at-least-once delivery with idempotent handlers.
A widely used broker with exchanges, queues and routing keys, acknowledgements and dead-lettering; official .NET client RabbitMQ.Client.
A distributed, partitioned log for high-throughput event streaming and replay, used from .NET via Confluent.Kafka.
Azure's managed broker with queues, topics, sessions and dead-letter queues, accessed via Azure.Messaging.ServiceBus.
Apache's JMS-based broker; ActiveMQ Artemis is the current generation. Supports AMQP, so .NET clients can connect.
A pure C# port of ZeroMQ: brokerless socket patterns (pub/sub, request/reply, push/pull) for low-latency messaging inside your own processes.
Abstractions over brokers that handle serialisation, retries, routing, sagas and outbox patterns, so you write message handlers instead of transport plumbing.
A message bus over RabbitMQ, Azure Service Bus, Amazon SQS and others, with consumers, sagas and a transactional outbox; version 9 introduced commercial licensing.
A commercial service bus from Particular Software with sagas, recoverability and monitoring tools.
A simple API for RabbitMQ that covers publish/subscribe and request/response without the broader bus features.
A single entry point in front of services that handles routing, auth, rate limiting and aggregation, so clients do not need to know the internal topology.
Package each service with its runtime so it runs the same everywhere, then orchestrate many containers in production. dotnet publish can build container images directly without a Dockerfile.
Build images with multi-stage Dockerfiles using the official mcr.microsoft.com/dotnet SDK and runtime images; Compose runs the app with its database locally.
Orchestrates containers with deployments, services, config maps and health probes; map ASP.NET Core health checks to liveness and readiness probes.
Frameworks that take on distributed-systems plumbing such as service discovery, state, actors and observability, each with its own opinion on how services should be built.
An opinionated stack for building distributed apps: an AppHost project wires services and dependencies, with service defaults for telemetry and a local dashboard. Also useful for integration tests.
A virtual actor framework where grains are activated on demand across a cluster, simplifying stateful, highly concurrent services.
Libraries for cloud-native .NET services: configuration servers, service discovery, management endpoints and connectors, from the Spring ecosystem's maintainers.
A sidecar runtime exposing building blocks (service invocation, pub/sub, state, secrets) over HTTP or gRPC, with a .NET SDK; the infrastructure behind each block is swappable.
Automate restore, build, test and publish on every push, then deploy through environments with approvals. Cache NuGet packages and pin the SDK with global.json for reproducible builds.
YAML workflows in .github/workflows; actions/setup-dotnet installs the SDK, then run dotnet test and dotnet publish.
Azure DevOps CI/CD with YAML pipelines, built-in .NET tasks and deployment environments with approvals.
Pipelines defined in .gitlab-ci.yml running jobs in Docker images such as the .NET SDK image.
A hosted CI service with YAML config, reusable orbs and parallel test splitting.
Render text from templates and data, for HTML pages, emails, documents or code generation. Use a sandboxed engine when templates come from users.
ASP.NET Core's own syntax mixing C# into HTML with @; it powers MVC views, Razor Pages and Blazor components.
A fast, sandboxed text templating language that can also parse Liquid templates; popular for emails and code generation.
A fast Liquid template engine for .NET, safe for user-editable templates since templates cannot run arbitrary code.
Client-side .NET lets you build UIs in C# instead of JavaScript, for the web or native apps, sharing models and validation with your back end.
Libraries that show up in many production .NET codebases. You do not need all of them, but recognising what each solves saves you from reinventing it.
An interactive API reference UI for OpenAPI documents, added with MapScalarApiReference(); a common replacement for Swagger UI now that templates no longer include Swashbuckle.
An in-process mediator for sending requests and notifications to handlers, often used for CQRS with pipeline behaviours. It moved to a commercial licence for larger companies in 2025.
Strongly typed validation rules (RuleFor(x => x.Email).EmailAddress()) kept in separate validator classes, easy to unit test.
Resilience strategies (retry, circuit breaker, timeout, hedging, rate limiter) for outbound calls; Microsoft.Extensions.Http.Resilience builds on it.
Turns PostgreSQL into a document database and event store, with LINQ queries and projections for event-sourced systems.
Build automation written as a C# console project, with typed tool wrappers and CI config generation instead of YAML-heavy scripts.
BenchmarkDotNet runs micro-benchmarks properly, with warm-up, statistics and memory diagnostics. Run in Release mode and never trust a Stopwatch loop instead.
The DistributedLock library gives mutexes and semaphores across processes backed by SQL Server, PostgreSQL, Redis or the file system, so only one instance runs a critical section.