Skip to content

ASP.NET Core First StepsFrom first endpoint to deployment

Already code, but new to C#? Learn .NET 10 and Minimal APIs one concept at a time, with a complete runnable project in every chapter.

A 30-second preview

A complete Web API in just 17 lines ​

This is the program you will write by the end of Chapter 02: an endpoint that returns JSON, plus automatically generated interactive API documentation. There is no configuration file to edit and no boilerplate class to inherit from.

About the samples

Both editions use the same runnable projects. Code comments, sample data, and application messages are in English, so commands and responses match in either edition.

  1. Create a projectOne dotnet new web command creates a minimal web project
  2. Declare an endpointMapGet connects a URL to an ordinary function, and the return value is serialized to JSON automatically
  3. Run itdotnet watch starts the service and applies supported code changes with hot reload
  4. Open the docsVisit /scalar to test your endpoint directly in the browser
Program.cs
cs
using Scalar.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOpenApi();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.MapOpenApi();
    app.MapScalarApiReference();
}

app.MapGet("/", () => new { Message = "Hello, ASP.NET Core!" });

app.Run();

Learning path

Six stages, one main path ​

Later chapters build on earlier ones: EF Core uses dependency injection, and authentication uses middleware. The tutorial follows a single sequence, so we recommend reading it in order.

6 stages, 24 chapters · 24 available.

  1. Getting started

    Set up your tools, meet C#, and run your first endpoint

  2. Application foundations

    Connect services, manage configuration, and understand the pipeline

  3. Data access

    Store data in SQLite with EF Core and build a complete API

  4. Security

    Identify callers and decide what they can do

  5. Going live

    Test your API, organize its code, and deploy it

Built with .NET 10 and Minimal APIs · Runnable examples in every chapter