
Explore http basics, client-server communication, and rest api concepts; set up your local environment, create an empty dotnet web api, and practice routing, model binding, and a simple http client.
Create a new web api project with dotnet cli, name it Restaurants.API, scaffold a solution, add the project to it, and run the default weather forecast endpoint returning json.
Set up a dotnet eight web api project, configure launch settings, and register controllers. Test the weather forecast endpoint with routing and api prefix using the built-in http file.
Explore how ASP.NET Core 8 Web API routes requests to controller actions and uses model binding to supply parameters from body, query, route, or header.
Learn how ASP.NET Core returns status codes, from informational 100 to server errors, and how to override defaults using direct response status, status code results, or dedicated action results.
Create and test the first endpoint that generates weather data by posting a count and temperature range, validating input and returning 200 ok or 400 bad request.
Add domain, application, and infrastructure modules to a clean architecture solution, linking domain models like restaurants and addresses to the application use cases and the API presentation layer.
Learn how to replace manual mapping with AutoMapper in ASP.NET Core 8 Web API by creating profiles, configuring ForMember mappings for nested properties, and registering AutoMapper in dependency injection.
The name of this package has changed to just "Automapper" - if you did install it, as it was in the video just change the package in your Restaurants.Application.csproj:
from
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
to
<PackageReference Include="AutoMapper" Version="13.0.1" />
it has no breaking changes
Demonstrates read and create operations in an ASP.NET Core 8 Web API: retrieve all or by id, create a restaurant using a create restaurant dto and AutoMapper, returning 201 created.
Demonstrates implementing fluent validation for CreateRestaurantDto, replacing attributes with a dedicated validator, configuring DI, and defining rules for name, description, category, email, phone, and postal code.
Learn how to apply cqrs in a dotnet web api by separating writing commands from reading queries using MediatR, with handlers and registering in service collection.
Learn how to implement a delete restaurant endpoint using CQRS with MediatR, creating a delete command and handler, checking existence, and returning 204 no content or 404 not found.
Implement a patch endpoint at /api/restaurant/{id} to update a restaurant name, description, and hasDelivery; return 204 on success, 404 if not found, via mediator command with validation and automapper.
Implement structured logging in a .NET 8 web API using Serilog, configuring log levels, sinks, formats, enrichers, and EF Core logging for production troubleshooting.
Extend Serilog logging by adding a file sink with daily rolling and size-based rollover, configured via appsettings development json, while preserving console output for endpoints like get all restaurants.
Replace boolean existence checks with a custom not found exception across commands and queries. Configure error handling middleware to translate not found exceptions into 404 responses and log the event.
Create a time logging middleware for asp.net core 8 web api using IMiddleware and Stopwatch to log the http verb, path, and elapsed time only when it exceeds four seconds.
Adapt endpoint structure to match rest api guidelines, enabling creation, retrieval, and removal of restaurant subresources.
Implement endpoints to retrieve all dishes for a restaurant and a single dish by id, using mediator queries, dish dto mapping, and proper not-found handling.
Implement a delete endpoint to remove all dishes for a restaurant's sub-entities, using a mediator command and handler, returning 404 if the restaurant is missing, and 204 on success.
Refactor the web api startup by extracting presentation layer services into a WebApplicationBuilder extension, preserving swagger and identity endpoints while cleaning up program.cs.
Learn to pass authenticated user context into the application layer by building a current user model from claims, via a reusable user context service and http context accessor.
Extend the identity user by adding date of birth and nationality, apply a migration, update the identity dbcontext and endpoints, and implement a patch to update these properties via mediator.
Introduce authorization after authentication by implementing role-based access control with three roles and identity role support, then add custom claims and enforce resource ownership for deletions and modifications.
Define and seed roles (user, owner, admin) for an ASP.NET Core 8 API, configure role-based authorization with claims, and enforce access using the authorize attribute on endpoints.
Develop an admin-only endpoint in the identity controller to assign a user to a role using the mediator pattern, with user manager and role manager checks and 404 handling.
Define the has nationality policy using a custom authorization builder. Apply the policy to endpoints to enforce nationality claim existence or value-based access control.
Configure a one-to-many relationship between users and restaurants by adding an owner id and foreign key, migrate the database, and set the current user as the restaurant owner on creation.
Create a custom authorization policy requiring a user to own at least two restaurants, register the handler in DI, and apply it to the get all restaurants endpoint.
Master Clean Architecture & Azure for Scalable APIs in ASP.NET Core 8
Ready to build robust, high-performance RESTful APIs with confidence? This comprehensive course empowers you with the knowledge and skills to create modern web APIs using the powerful combination of ASP.NET Core 8, Clean Architecture, and Azure services.
Your journey begins with understanding the fundamentals:
RESTful API essentials: Demystify HTTP communication, grasp REST principles, and set up your local development environment.
ASP.NET Core 8 mastery: Dive into routing, model binding, and HTTP client usage to build the foundation of your API.
Clean Architecture adoption: Learn the benefits and principles of Clean Architecture, and apply them to structure your API for maintainability and flexibility.
Next, you'll establish the infrastructure:
Database connection with Entity Framework: Set up your MS SQL database and leverage Entity Framework for seamless data interaction.
Seeding mechanism: Populate your database with essential data for realistic testing and functionality.
Ready to build features? Buckle up!
RESTful resource management: Create, retrieve, update, and delete resources following REST best practices.
DTO mapping and validation: Ensure data integrity and security with efficient mapping and Fluent Validation.
Command/Query Responsibility Segregation: Organize your code with a clear separation of concerns using MediatR.
More than just features - enhance your API's robustness:
Logging with Serilog: Track API events for troubleshooting and maintainability.
Automated documentation: Generate clear API documentation for easy client integration.
Global exception handling: Gracefully handle errors and provide informative feedback to clients.
Deep dive into advanced topics:
Sub-entity management: Handle nested resources within your main entities with proper RESTful structure.
User authentication and authorization: Secure your API with user accounts, roles, and custom claims using ASP.NET Identity.
Pagination and sorting: Optimize performance for large datasets with pagination and sorting capabilities.
Testing and deployment are crucial:
Automated unit and integration tests: Ensure code quality and prevent regressions with comprehensive testing strategies.
Azure deployment: Leverage Azure App Service and Azure SQL to deploy your API to a scalable cloud environment.
CI/CD pipelines: Automate deployment processes for efficient updates and bug fixes.
By the end of this course, you'll be equipped to:
Architect and build secure, maintainable, and scalable RESTful APIs.
Confidently leverage Clean Architecture principles for code organization.
Utilize powerful Azure services for deployment and scalability.
Implement best practices for performance, logging, testing, and documentation.
Enroll now and take your .NET WEB API development skills to the next level!