ASP.NET Core – 100+ Lab Exercises (Basic, Intermediate, Advanced))

🔰 Basic Level (30+ Exercises)

 

Goal: Build a strong foundation in ASP.NET Core development and web fundamentals.

 

Getting Started with ASP.NET Core

  • Set up ASP.NET Core SDK and Visual Studio/VS Code.

  • Create your first ASP.NET Core MVC Web App.

  • Understand the Startup.cs and Program.cs pipeline.

  • Implement a basic Hello World endpoint using Razor Pages.

  • Create a Model-View-Controller (MVC) structure from scratch.

Request Handling & Routing

  • Build endpoints using attribute routing.

  • Use conventional routing in Startup.cs.

  • Create and consume query strings and route parameters.

Forms & Models

  • Create a form submission using Razor Pages.

  • Bind form data to a C# model.

  • Add model validation using Data Annotations.

Authentication Basics

  • Implement cookie-based authentication.

  • Create basic login, logout, and register functionality.

  • Setup role-based access with [Authorize(Roles = "Admin")].

CRUD Operations

  • Create a Product Management CRUD module.

  • Use Entity Framework Core (EF Core) to:

    • Create a DB Context.

    • Add/update/delete records.

    • Run migrations and seed data.


 

🚀 Intermediate Level (40+ Exercises)

 

Goal: Master backend patterns, authentication, data access, and ASP.NET extensibility.

 

Entity Framework Core Deep Dive

  • Scaffold models from an existing database.

  • Use LINQ queries for filtering and projection.

  • Implement soft deletes and tracking behavior.

  • Add one-to-many and many-to-many relationships.

Middleware & Services

  • Create and register custom middleware.

  • Inject and use dependency injection (DI) for services.

  • Create a reusable repository pattern.

Advanced Routing & Filters

  • Use action filters and global exception filters.

  • Build custom model binders.

  • Implement localized routing for multi-language support.

Authentication & Authorization (Advanced)

  • Implement Identity Framework.

  • Integrate JWT-based authentication.

  • Add external login using Google or Microsoft accounts.

  • Secure Web APIs using [Authorize] and policies.

Razor Pages & Blazor (Optional)

  • Convert MVC views to Razor Pages.

  • Build a basic Blazor Server component.

  • Use Blazor forms with validation and dependency injection.


 

🧠 Advanced Level (40+ Exercises)

 

Goal: Build scalable APIs, implement advanced architecture, and prepare for production deployments.

 

Building RESTful APIs

  • Create a REST API using ASP.NET Core Web API.

  • Use Swagger/OpenAPI to document your API.

  • Implement versioning (e.g., /api/v1/...) and custom response formats.

  • Add rate limiting middleware.

Unit Testing & Integration Testing

  • Write unit tests for controllers and services using xUnit.

  • Mock dependencies with Moq.

  • Implement integration testing for full API flows.

Performance Optimization & Caching

  • Add in-memory and distributed caching (Redis).

  • Profile API using MiniProfiler or Application Insights.

  • Add response compression and GZip.

Background Tasks & Hosted Services

  • Create a background worker using IHostedService.

  • Schedule recurring tasks with Quartz.NET.

  • Send emails via background jobs (Hangfire, Serilog).

Microservices, Docker & DevOps

  • Containerize your app using Docker.

  • Deploy using Azure App Service or AWS Elastic Beanstalk.

  • Use Consul for service discovery.

  • Implement gRPC services for microservice communication.

Capstone Projects

  • E-Commerce Admin Portal (Blazor or Razor Pages + Web API + EF Core + JWT)

  • Job Application Tracker (REST API + Authentication + Caching)

  • School Management System (Razor + MVC + Multi-role Authorization + DB-first)

  • Healthcare Appointment System (gRPC + Hosted Services + API Gateway)


 

Tools & Technologies

 

  • Languages: C#

  • Framework: ASP.NET Core 6/7/8, EF Core

  • IDEs: Visual Studio 2022, VS Code

  • Testing: xUnit, Moq, FluentAssertions

  • Database: SQL Server, PostgreSQL, SQLite

  • DevOps: Docker, Azure Pipelines, GitHub Actions

Scroll to Top