
Explore solid principles and clean architecture in ASP.NET Core, applying the solid principles, mediator and fluent validations, and robust testing across api, Blazor, and ui layers.
Explore the solid principles: single responsibility principle, open-closed principle, substitution principle, interface segregation principle, and dependency inversion principle, to write modular, maintainable ASP.NET Core code.
Explore separation of concerns and the single responsibility principle to create modular, maintainable code. Split functionality into dedicated classes to avoid bloated, hard-to-maintain classes.
Apply the dry principle to avoid repetition, establishing a single implementation point that supports maintainability, aligns with the single responsibility and open/closed principles, and underpins dependency inversion in SOLID.
Discover how dependency inversion promotes loose coupling by abstracting dependencies with interfaces and injecting them into classes, with asp.net core’s built-in ioc container enabling maintainable, reusable code.
Explore common software architectures and learn how clean architecture improves testability and loose coupling. See how the application core, infrastructure, and user interface interact in API-driven ASP.NET Core projects.
Tour the ASP.NET Core app, tracing its move from a 3.1 all-in-one design to layered and emerging clean architecture, with refactoring from fat controllers and code smells toward maintainability.
Explore development environment in Visual Studio 2022 for building a restful api with dot net seven and dot net six compatibility, applying clean architecture, SOLID principles, and Entity Framework Core.
Install Visual Studio 2026 insider preview and select workloads like ASP.NET web development, Maui, Azure, and desktop development; enjoy a refreshed user interface with integrated Copilot chat.
We set up a blank solution, rename it to air dot leave management dot clean, and organize folders for api, core, infrastructure, ui, and tests to enforce separation of concerns.
Map the solution folders to the clean architecture diagram, placing domain entities and application interfaces in the core, while outlining infrastructure, API, tests, and UI folders.
Explore responsible AI use in modern development, review best practices and guidelines, and vet Copilot in Visual Studio and Visual Studio Code while balancing fundamentals with safe coding and limitations.
Set up the application course at the center, with the core containing domain entities and application interfaces to implement. Start with the domain project, then move along.
Create the domain project inside the core folder as a class library for the leaf management domain, defining leaf type, leaf allocation, and leave request.
Define the application core by creating contracts and persistence, implementing a generic repository and leaf type repositories, and aligning with the repository pattern using the EF Core data context.
Explore how AutoMapper facilitates converting between domain entities and DTOs, and apply the CQRS pattern with Mediator to route commands and queries through handlers for lean controllers.
Register auto mapper and mediator via extension methods, configure dependency injection with assembly scanning, and create mapping profiles to convert between DTOs and domain entities.
Structure a features folder in vertical slice architecture, using commands and queries for leaf type management, and map a leaf type detail DTO with id, name, and default via AutoMapper.
Implement a cqrs get leave types query and handler with mediator, map leave type domain objects to dto, query the repository, and return a dto list to the api.
Create a CQRS get leaf type details query and handler, returning a details dto via repository fetch by id, with mapping configured in the leaf type details profile.
Learn to implement a CQRS create leaf type command and handler, map to domain objects, persist with a repository using EF Core, and return the new id.
Develop the update leaf type command and its handler returning unit, and implement the delete leaf type command with a handler using repository get by ID and remove.
Explore how to add custom exceptions to control application flow, define not found exception and bad request exception, and tailor messages with a name and key for clear error handling.
Learn to implement fluent validation in ASP.NET Core, creating validators with rules for required fields, max length, and async checks, including database uniqueness via a repository.
We set up the application core by defining domain and application projects, hosting domain entities, persistence contracts, and data types for business logic, using mediator, auto mapper, and fluid validation.
Explore implementing the infrastructure layer in an ASP.NET Core clean architecture, wiring repository contracts with Entity Framework Core and data access, and integrating third-party services like email and logging.
Create the persistence project to implement persistence contracts, reference the application, install Entity Framework for SQL Server and configuration extensions, and add a persistence service registration class for dependency setup.
Create db context with Entity Framework Core; map leaf types, leave allocations, leave requests. Override save changes for audit fields; apply configurations from assembly; register SQL Server via configuration.
Implement generic and specific repositories in the persistence layer. Inject the db context, create CRUD methods, and register scoped services for leave type, leave allocation, and leave requests.
Enable no-tracking queries in EF Core for get and get by id to bypass the change tracker, improving API query performance; refactor repository interfaces to require a base entity.
Implement leave request and leave allocation repositories in the persistence project under the infrastructure layer, using entity framework core to include details and filter by user.
Create the leave management infrastructure project to host contract implementations, set up a public static infrastructure services class with a service collection method, and prepare to integrate the email service.
Implement a cloud-based email service with SendGrid, defining the email sender contract and models for email message. Configure IOptions and register the email service with the API key.
Implement a logging abstraction in ASP.NET Core by creating IAppLogger and a LoggerAdapter, register it in infrastructure services, and use it in handlers for information and warnings with placeholders.
Review section milestones by setting up the persistence project, implementing repositories, creating the infrastructure project for third-party services, configuring email and logging with strongly typed options, and reviewing source control.
Develop the ASP.NET Core API by applying dependency injection, scaffolding an EF Core database, and building theme controllers using mediator while implementing the leave allocation and leave request features.
Create a dotnet core api project and explore the default controller, models, and program wiring. Register services such as persistence and repositories, enable open api, and map requests to actions.
Configure the api project by wiring extension-based services from application, infrastructure, and persistence, wiring app settings for email and connection strings, and enabling a course policy for external requests.
Scaffold a database by installing core tools, setting the correct startup project, adding an initial migration for leave types, leave allocations, and leave requests, then update the database.
Implement a thin api controller for leave types using MediatR, sending a get leave types query to its handler and returning a leave type dto, with Swagger OpenAPI support.
Implement and test a MediatR-based controller for leave types, covering get by id, create, update, and delete, with validation, AutoMapper mappings, Swagger documentation, and robust error handling.
Implement the complete leave request feature with queries and commands, including list and detail views, create update delete, cancel, and change approval workflows, plus shared validation and base leave request.
Implement a global exception middleware for an ASP.NET Core app to map exceptions to appropriate HTTP status codes and return custom validation problem details.
Configure the api project, inject dependencies, create the database with entity framework core; implement global exception handling and configuration, and add leave allocation and leave request handlers for now.
Explore how solid principles improve testability by authoring unit and integration tests with xUnit and mock frameworks, enabling fluent assertions and regression testing to preserve existing functionality.
Set up a mock leaf type repository to unit test the leaf types handler, using dependency injection and mocked GetAsync to validate known outcomes.
Evaluate integration testing with Entity Framework Core using an in-memory database to ensure create and update operations set date created and date modified, validating third-party data access through xUnit tests.
Validate that code operates as expected with automated tests, using mocks for dependencies in clean, modular designs. Distinguish unit and integration tests and write more tests.
Add UI for an ASP.NET core app using Blazar, generate code for API integration with Swagger Studio, configure JWT security with admin and employee roles, and build leave management interface.
Create a Blazor WebAssembly UI project within an ASP.NET Core solution, exploring project setup, templates, and core structure, including wwwroot, pages, components, and HTTP client integration with an API.
Add a typed http client for the api, set the base address from the api uri, and create contracts and implementations for leaf type, leave allocation, and leave request services.
Create a leave type management service by building client-side view models, mapping API data with AutoMapper, validating input with client-side data annotations, and handling API exceptions with a response type.
Create a Blazor UI for leave type management with a types table and actions to create, edit, delete, and allocate, powered by Razor components and API calls.
Set up identity services in ASP.NET Core, configure identity core, and secure API and frontend interactions with administrative and employee roles using JWT authentication.
Configure identity db context and services, seed roles and users, and implement jwt authentication with login and register endpoints to secure the api.
Integrate authentication into the Blazor user interface by updating the API, generating auth files, implementing local storage token handling, and a custom authentication state provider to secure API calls.
Review the segment on blazer web assembly for a single page app, code generation with Nswc Studio, custom components, and identity with JWT security for API communication.
Overview
Many developers can build an ASP.NET Core CRUD application. Fewer know how to structure that application so it remains testable, maintainable, and easy to extend as requirements change. This course shows you how to take a real application and reshape it using SOLID principles and unit testing.
Learn how to refactor and structure an ASP.NET Core application using SOLID principles, Clean Architecture, CQRS, MediatR, EF Core, JWT authentication, validation, testing, and modern .NET practices. This course helps you move beyond basic CRUD development and design applications that are easier to test, maintain, and extend.
This course does not start with a tiny toy example. You work with an existing ASP.NET Core application and learn how to improve its structure the way developers often do in real projects: by identifying architectural problems, separating responsibilities, introducing application layers, adding validation, handling errors properly, securing APIs, and testing business logic.
Why SOLID Architecture?
When we talk about SOLID architecture, what we refer to isn’t straightforward. Decisions made early in the process can have a significant impact later on, and maintainability and testability play important roles. Adopting these practices can also help avoid code smells, refactor code, and facilitate more efficient agile development.
SOLID stands for:
S - Single-Responsibility Principle
O - Open-closed Principle
L - Liskov Substitution Principle
I - Interface Segregation Principle
D - Dependency Inversion Principle
In this course, you explore foundational architectural principles that help create maintainable code. You will discover how to set up a real-world application architecture with ASP.NET Core. Then, you’ll learn how to plug in common blocks such as email and authentication, and build a foundation for adding other third-party services as needed.
When you finish this course, you’ll have the skills and knowledge to create a testable and maintainable ASP.NET Core application to architect real-world enterprise .NET Core apps.
N.B. - The project in this course is based on the deliverables in Complete ASP.NET Core and Entity Framework Development. While it is not mandatory to take this course, much of the existing code will be reused from its content.
Build A Strong Foundation in .NET Clean Architecture:
Learn Clean or Onion Architecture and Best Practices
Learn Command Query Responsibility Segregation (CQRS)
Implement Mediatr Pattern
Add Email Service using SendGrid
Efficient Exception Handling and Routing
Implementing Unit Testing
Moq and Shouldy
Global Error Handling with Custom Middleware and Exceptions
Adding Validation Using Fluent Validation
Build a .NET Core API and Blazor UI Application
Implement JWT(JSON Web Token) Authentication
Content and Overview
To take this course, you must have some knowledge of .NET Core development and C#.
This is a huge course. Over 10 hours of premium content, but smartly broken up to highlight related activities based on each module in the application being built. We will also look at troubleshooting and debugging errors as we go along, implementing best practices, writing efficient logic, and understanding why developers do things the way they do. Your knowledge will grow, step by step, throughout the course, and you will be challenged to be the best you can be.
We don't do things perfectly the first time; that is different from the reality of writing code. We make mistakes, point them out, and fix them. By doing this, we develop proficiency in using debugging tools and techniques. By the time you have finished the course, you will have moved around in Visual Studio and examined logic and syntax errors so much that it will be second nature for you when working in the .NET environment. This will put your newly learned skills into practical use and impress your boss and coworkers.
The course includes working files hosted on GitHub, including resources to make it easier for you to replicate the code demonstrated. You will be able to work alongside the author as you work through each lecture and will receive a verifiable certificate of completion upon finishing the course.
Clicking the Take This Course button could be the best step you could take towards quickly increasing your income and marketability! Also, remember that if you don't think the course is worth what you spent, you have a full 30 days to get a no-questions-asked refund!
Best for late-beginner to intermediate ASP.NET Core developers who already know the basics and want to write cleaner, more maintainable application code.
It's time to take action!
See you in the course!