ASP.NET Core APIs with Copilot
Build enterprise ASP.NET Core APIs with GitHub Copilot in Visual Studio 2026 — versioned endpoints, validation, OpenAPI, observability, and rate limiting on an AdventureWorks dataset.
View badge details
About This Course
Learn to build enterprise-grade ASP.NET Core APIs with GitHub Copilot in Visual Studio 2026 as your pair-programmer. This course teaches minimal-API design under Copilot grounding, OpenAPI-first contracts, validation and typed error handling, structured observability, and the enterprise rate-limit pattern grounded in the acquired AdventureWorks dataset Dana Reyes's team is modernizing onto Halcyon Insurance's .NET 10 stack. By the end you will be able to scaffold a versioned, validated, instrumented production-ready Web API against an existing enterprise schema using Copilot's Ask, Edit, and Agent modes with Halcyon's conventions pinned via copilot-instructions.md.
Course Curriculum
6 Lessons
Design APIs with Copilot Ask mode and grounding files
Teaching lesson on OpenAPI-first API design. Walks Dana Reyes through the four-phase design loop, the controllers-vs-minimal-APIs decision table for .NET 10, grounding Copilot via .github/copilot-instructions.md and a Copilot Space, and using Copilot Ask mode as a design-review partner on a draft OpenAPI 3.1 contract. Lands three artifacts before Lesson 2's scaffold: a reviewed contract, a repo instructions file, and the Halcyon Architecture Space.
Scaffold the Products API with Copilot ghost text and a /scaffold-crud prompt file - Lab Exercises
Dana Reyes opens VS 2026, signs into GitHub Enterprise, and takes the design-reviewed OpenAPI contract from Lesson 1 to a running Halcyon.Adventure.Api scaffold. Students practice Copilot ghost-text completions on a Products controller skeleton, add URL + header versioning via Asp.Versioning.Http, author a reusable .github/prompts/scaffold-crud.prompt.md prompt file invoked from Chat, verify the generated OpenAPI 3.1 document matches the contract, and open the PR with a Copilot-generated title and description.
Shape API contracts and validation with Copilot Ask and Edit modes
Teaching lesson pairing GitHub Copilot Chat with .NET 10's new built-in validation. Opens on Christopher's PR-review blocker from Lesson 2 — bare 400s coming back with no body — and walks through RFC 7807 problem-details, AddValidation(), IValidatableObject for cross-field rules, and a custom IProblemDetailsService that threads a Halcyon trace id onto every error response. Introduces FluentValidation as a comparison and builds the mental model for Copilot Ask-mode contract review and Edit-mode multi-file working sets that Lesson 4 exercises hands-on.
Add validation and typed errors with Copilot Edits - Lab Exercises
Note: This lab pre-provisions a Windows VM, leases a GitHub Enterprise user from the ghdev pool on skillmeupai.ghe.com, and sets up Copilot licensing — allow up to 12 minutes for the environment to become ready before beginning the exercises.
Hands-on companion to Lesson 3. On a fresh Windows 11 VM with Visual Studio 2026 and the Halcyon.Adventure.Api starter already pulled, drive GitHub Copilot Edit mode (Copilot Edits) across five coordinated changes: register AddValidation() with DataAnnotations on the request records, add Halcyon's price-vs-cost IValidatableObject cross-field rule, implement a custom IProblemDetailsService delegate that threads the correlation trace id onto every error response, and introduce FluentValidation on exactly one endpoint for a feel-the-delta comparison. Close with a Copilot-authored PR title + description.
Drive observability and rate-limiting from Copilot Chat
Teaching lesson. You don't hand-type observability boilerplate anymore — you describe what you need and let Copilot Chat draft it. The lesson walks you through drafting a correlation-ID middleware, ILogger business-id scopes, OpenTelemetry wiring, and System.Threading.RateLimiting policies from plain-English requirements — leaving you with four reusable Chat prompts you can paste into any API build.
Instrument for prod with Copilot Agent mode and the @debugger specialized agent - Lab Exercises
Hands-on. Drive Copilot Agent mode end-to-end on the instrumentation work for Halcyon.Adventure.Api — correlation-ID middleware, ILogger business-id scopes, a fixed-window global rate limiter, and a sliding-window per-endpoint policy. Use @debugger to triage a deliberate logger-scope bug. Scaffold an NBomber load-test suite that proves both policies hold under burst. Run the Git agent review on the pre-PR commit, then triage Copilot's PR-time review comments against the Git agent's.