
Learn how HTTP enables client-server communication on the web, with requests (methods, headers, bodies) and responses (status, headers, body), and how get, post, put, and patch drive stateless APIs.
Explore REST as an architectural style for building RESTful web services, emphasizing stateless operations, client-server separation, a unified interface, data independence, layering, caching, and language-agnostic deployment with .NET.
Video for linux/macOS users explaining the necessary commands and tools to be able to follow along during the course.
Commands and tools are listed in the resource 'linux & macOS Resources.txt'
Discover how the startup class shapes an ASP.NET Core API by configuring services for dependency injection and building the request pipeline with middleware, illustrated by a hello world example.
Master dependency injection as a design pattern that decouples components by programming against interfaces, enabling plugin architecture, flexible service wiring, and testability in .NET Core.
Create and map three entity classes Location, Lecture, and Meetup in an IT Entities catalog, leveraging Entity Framework conventions to auto-generate primary keys and define relationships.
Create a migration in entity framework core with add migration init to generate migrations folder, model snapshot, and migration file, update-database builds Meetup DB with tables and relationships.
Seed an ASP.NET Core API database by creating a seeder class, checking connectivity and empty meetups table, inserting sample meetups, saving changes, and registering the context for dependency injection.
Use Postman as an http client to test an ASP.NET Core API by sending requests with verbs, headers, and a body, and adjust SSL certificate verification and two point view.
Create the first ASP.NET Core API controller, map http get and post actions with route, query, and body bindings to serve weather data, and test with Postman.
Understand http status codes from 100 informational to 500 server errors, including 300 redirection, and implement returns in an ASP.NET Core controller using HttpContext.Response.StatusCode, StatusCode, or NotFound, with default 200.
Create a get-by-name endpoint that returns a single meetup details DTO by name, handling spaces by replacing with dashes and lowercase; returns 404 if not found, 200 with mapped DTO.
Create a post method in the meetup controller that accepts model from the body, maps it to an entity with AutoMapper, saves with Entity Framework, and returns 201 with location.
Master the meetup modification flow by implementing an http put method to edit meetups, validate models, update fields, save changes, and verify via Postman.
Implement a delete endpoint in the meetup controller using http delete with the name parameter, verify existence, remove the meetup via meetup context with entity framework, and return no content.
Fetch sub-resources by including lectures in the meetup details and by adding a dedicated endpoint to retrieve lectures for a specific meetup, demonstrated via mapping and Postman tests.
Configure NLog in an ASP.NET Core API by adding the NuGet package and NLog.config, set a file target and rules, inject the logger, and log deletions for a meetup.
Learn to generate automatic API documentation with Swagger for an API with eight endpoints. Configure Swashbuckle in Startup.cs, enable Swagger UI, and test endpoints.
Define authentication and its role in securing an api; cover the three categories and two-factor authentication, and prepare user tables with registration and password hashing.
Add user and role entities to enable email authentication with hashed passwords, link users to roles via a foreign key, and seed initial roles.
Create an account controller with a post register action that binds a register model from the body, validates input, and saves a new user with a default role.
Learn how to securely store user passwords using password hashing in ASP.NET Core, leveraging the built-in password hasher and dependency injection to protect against data breaches.
Refactor data validation using FluentValidation to enforce unique email, required fields, password length, and password confirmation, centralizing rules in a register user validator and wiring it in startup.
Enable secure user authentication with JWT tokens by hashing passwords, creating and validating tokens with claims, signing keys, and configuring bearer authentication in ASP.NET Core.
Learn to implement claim-based authorization in dotnet core by adding optional nationality claims, registering a 'has nationality' policy, and enforcing it on API actions using the authorize attribute.
This lecture demonstrates a custom authorization policy in ASP.NET Core using a minimum age requirement and a handler that checks a date of birth claim to enforce at least 18.
Implement resource based authorization in ASP.NET Core by creating a resource operation requirement and handler that allows create and read, and restricts update or delete to the resource creator.
Explore the five ASP.NET Core filters—authorization, resource, action, exception, and result filters—and learn how to use action filters for metrics, exception filters for global errors, and authorization filters for security.
Apply the service filter attribute to inject dependencies into the time track filter, apply it at the controller level, and register it in the dependency injection container with dedicated logging.
Explore cross-origin resource sharing in asp.net core, showing how browsers block cross-domain requests and how to implement a cors policy to allow localhost:3000.
Design functional actions to reload configuration at runtime, independent of resources. Implement a config controller with a reload action using http options and cast to configuration root type.
The .NET Core platform is the latest tool from Microsoft enabling the creation of cross-platform applications, including web and web APIs.
Due to its high performance, open-source code, and the possibility of implementation on various systems, it is becoming more and more popular.
The course presents how using ASP.NET Core a web API application is created, which ultimately can be consumed by SPA (single page application), mobile applications, IoT applications, or any application where communication takes place via the HTTP protocol. First of all, the course will show you how to build applications in accordance with the REST architecture. Good practices will be discussed, such as dependency injection, auto-mapping, error logging, model validation, use of object-relational mapping.
During the course you will:
- create an application that according to the REST architecture will: read, create, modify or delete data from the server
- send database queries from code using ORM (Entity Framework Core)
- create an MS SQL database based on classes in C #
- validate incoming models and return appropriate messages in case of incorrectness
- use the auto-mapper
- use the built-in container to inject dependencies
- log errors or specific information to a text file
- create documentation (using the Swagger tool)
- configure NLogger
- use the Postman to consume the web API
- authenticate users via JWT tokens
- create your own authorization policies
- create a user and role entities tables
- hash users passwords
- authorize based on users claim and its value