
Explore REST, SOAP, and GraphQL and compare their pros and cons; focus on REST's resource identification, statelessness, HTTP verbs, and uniform interface.
Begin by creating a web api and explore the basics of an ASP.NET Core web api to start your project.
Install Visual Studio Code from the official site, choose your operating system, run the installer, accept defaults, create a desktop icon, and launch the application.
Create a web api from scratch in Visual Studio using an empty ASP.NET Core template, name it minimal APIs movies, and prepare to use dotnet nine and Visual Studio Code.
Explore nullable reference types and non-nullable reference types, how to enable or disable them, understand warnings for null values, and leverage implicit usings to reduce clutter.
Explore the program class as the core startup for dotnet apps, configure builder settings, register services via dependency injection, and define middlewares and endpoints for handling http requests.
Explore how a cross-origin fetch to the web API's genres endpoint triggers a CORS error and learn how to configure the API to allow requests from that origin.
Apply cors policies to endpoints using the cors middleware in the program class, ensuring endpoints adopt the policy named free to allow any origin during development.
Explore how caching improves performance by storing frequently requested data, such as genres, in server memory or on the client device to reduce database calls.
Implement output cache in an ASP.NET Core app by enabling the output cache middleware, configuring a 15-second expiration, and serving the genres endpoint from memory to reduce database calls.
Install Swashbuckle, enable API explorer and Swagger UI, and view your endpoints on a web page driven by a JSON specification.
Explore RESTful principles, configure CORS to control origins, implement output cache for simple caching, and use Swagger to visualize API endpoints.
Discover code first and database first approaches in Entity Framework Core, creating classes to represent tables, configuring relationships and columns, and generating or connecting to databases for environment-specific synchronization.
Install entity framework core by adding the required NuGet packages, create an application DbContext, and configure the SQL Server connection string in appsettings and program.
Implement a genre repository interface and depend on the abstraction via dependency injection. Create a post endpoint to add genres with EF Core, saving asynchronously and returning new genre ID.
Create async genre fetch endpoints using a repository, exposing get all and get by id in minimal APIs. Address not found responses and cache consistency.
Use data transfer objects (DTOs) to shield entities from external clients, enabling independent evolution, and map DTOs for create and update while projecting reads to DTOs to prevent over posting.
Leverage AutoMapper to automate mappings between genre and genre DTO, configure profiles, and use IMapper to map lists and single genres in your minimal API.
Create and wire an actors repository in ASP.NET Core with Entity Framework Core, implementing CRUD operations, extracting interface, registering as a scoped service, and using no-tracking queries.
Update the actors endpoint to modify an actor by id, return no content, retrieve the actor, map updates with Automapper, manage picture changes via file storage, and refresh the cache.
Create two movie endpoints in the minimal api: get all with pagination and get by id, using repository, mapper, and output caching, with Swagger and Postman examples.
Implement a delete movie endpoint that retrieves by id, handles not found, deletes the movie and its poster file, clears the output cache store, and returns no content.
Create the comment entity with id, body, and movie id, and configure a one-to-many relationship between movies and comments using EF Core, migrations, and a foreign key with cascade delete.
Create a comments endpoint by defining dtos for create and read, mapping with automapper, and wiring a route /movies/{movieId}/comments to persist comments.
Get all and get by id endpoints fetch movie comments from repositories, map them to comment DTOs, and return 404 when the movie or comment is missing.
Build an endpoint to assign genre IDs to a movie, load existing genres with include, and use Automapper to add, remove, or keep relations before saving with EF Core.
Create a post endpoint to assign genres to a movie, validating movie and genre existence, returning not found or bad request, or no content on success, and test via swagger.
Establish a many-to-many relation between actors and movies using an actor_movie join entity with extra fields for order and character, and define a composite key on actor_id and movie_id.
Create an endpoint to assign actors to a movie using an assign actor movie dto with actor id and character, map via automapper, and validate existing actors before saving.
Configure entity relationships with Entity Framework Core, and implement file upload handling in your web API using Azure Storage or local storage, while building crud operations for all entities.
Enforce not empty validation for the genre name with a create genre DTO validator, returning clear 400 validation errors through a minimal ASP.NET Core 9 API.
Customize validation errors in a genre DTO validator by using a field name placeholder to produce meaningful messages, run in swagger, and confirm success when validation passes.
Implement asynchronous validation in the genres repository to prevent duplicate names during create and update operations, using an exists(name, id) check and swagger verification.
explain updating a genre with route id extraction via http context, using a create genre dto validator to prevent duplicate names and ensure safe updates.
Learn to implement multi-property validations in a DTO with an actor DTO validator, enforcing name and date of birth rules and returning structured validation errors in the create endpoint.
Validate movies by implementing a movie dto validator, enforcing non-empty title and max length 250, applying a validation filter to create and update endpoints, then test with Postman.
Modify the use exception handler middleware to customize error responses, expose a dedicated error endpoint that throws exceptions, and return a tailored 500 status with a clear error message.
Implement validations in minimal APIs and use filters to intercept endpoint execution. Learn how to handle errors and persist them to a database using EF Core in ASP.NET Core 9.
Build a token-based authentication test by using the dotnet user-jwts tool to create and print a json web token, then test endpoints with a bearer token in Postman.
Configure your ASP.NET core app to emit its own tokens using a base64 secret key stored in user secrets and a keys handler to manage issuer keys for token validation.
Register users by building a user credentials dto with email and password, apply validations, and generate a jwt-based authentication response with a token and expiration.
Implement a login endpoint that authenticates a user via the user manager and signing manager, checks password, handles lockout on failure, and returns a token with expiration.
Complete the comment entity by adding a non-nullable user id with a foreign key to users; ensure only registered users comment, then delete all comments and apply the migration.
Enforce that only the comment creator can update or delete it by validating the user against the comment's user id, returning 403 forbidden when mismatched.
Silently renew tokens with a dedicated endpoint to push the expiration forward during active use, ensuring seamless experience and validating the flow with Postman and bearer token.
Use ILogger to emit log messages across the console, text file, or database, explain log levels and categories, and configure per-category thresholds via app settings for minimal APIs.
Configure swagger in the program class to define a V1 OpenAPI doc with title, description, contact, and MIT license for the movies API.
Learn how to add descriptions to endpoints in ASP.NET Core minimal APIs using OpenAPI options, including endpoint summaries, parameter descriptions, and request body descriptions for updating genres.
Expose file uploads in swagger using openapi for actor and movie endpoints. Test with post and put, try it out, and note 401s when JWT is not provided.
Learn to dynamically order query results by passing a field and sort direction using System Link Dynamic Core, with string-based order by and error handling to prevent invalid fields.
Set up and configure Redis in ASP.NET Core to enable distributed output caching using the Stack Exchange Redis package, test via endpoints, and share cache across multiple API instances.
Debug a failing Azure web API by running it in the Azure console, reading the stack trace to fix allowed origins in appsettings.json, re-publish, and verify endpoints in Swagger.
Learn to diagnose production 500 errors by inspecting the errors table or Application Insights, identify the failure at users endpoints line 147, and fix production app settings and issuer secrets.
Learn how to develop Minimal APIs with ASP.NET Core from scratch with this amazing course.
We are going to see the entire life cycle of developing a Web API, from creating the solution, developing the endpoints, working on resource manipulation, to putting it into production in Azure and IIS.
In this course we will do a project which you will be able to publish and show as part of your portfolio.
We will also learn how to use Azure DevOps to configure a Continuous Integration and Continuous Delivery pipeline, to be able to publish your projects from their source code in Github, Bitbucket, or any other GIT repository provider.
Some of the topics we will see are:
Creation of REST Web APIs
Create a database
Use Entity Framework Core to read, insert, update, and delete records from a database
Create a user system so that our clients can register and log in to the Web API
We will use Json Web Tokens (JWT) for authentication
Claims-based authorization, so that only some users can use certain endpoints
Using cache to have a faster application
Using Redis for distributed cache
We will use GraphQL so that customers can indicate exactly what they want to consult
Web APIs are fundamental in modern web development. Since they allow us to centralize and protect the logic of our solutions. In addition, it is in a Web API that we typically have access to a central database with which all your users can communicate. Whether you build a social network, a delivery application, or even an office app, a Web API allows you to work on the back-end of mobile applications (Android, iOS, MAUI, etc.), web (React, Angular, Blazor, Vue, etc.), desktop, among others.