
Explore web APIs with minimal APIs in ASP.NET Core, learning from scratch what a web API is, the different styles of web API architecture, and technologies used in this course.
Explore how web APIs use a standardized interface over HTTP to let programs communicate across the internet, with real-world analogies and chat app examples.
Architect a solution around a central web api for a movie app, connecting a database to users via Angular and Maui interfaces, with admin tasks and ml-based recommendations.
Explore REST, SOAP, and GraphQL and compare their pros and cons; focus on REST's resource identification, statelessness, HTTP verbs, and uniform interface.
Explore how soap uses xml and wsdl to define standardized messages, compare rest and soap's limitations, and explain why modern minimal APIs favor rest over soap.
GraphQL lets clients request exactly the data they need through queries, reducing endpoints and avoiding over-fetching in REST, illustrated by a movie API with comments.
Explore .NET as a cross-platform development platform for Windows, Linux, and macOS, supporting languages like C#, F#, and Visual Basic. Understand the evolution from the .NET Framework to .NET Core.
Explore C sharp, a multi-paradigm, strongly typed language in dotnet, used to build web, mobile, and interactive apps, including web APIs with ASP.Net core.
ASP.NET Core is a cross-platform framework for building dynamic web applications, with routing, user management, and dependency injection to streamline common functionalities while delivering speed improvements.
Compare controllers and minimal APIs when building APIs in .NET core. See how controllers group actions and apply global logic, while minimal APIs define endpoints with map get.
Learn to design web APIs using rest architecture and GraphQL options, built fast on ASP.NET Core 9 for multi-platform, client-driven data selection.
Begin by creating a web api and explore the basics of an ASP.NET Core web api to start your project.
Install dotnet 9 SDK across Windows, Linux, and Mac OS, download from dotnet nine downloads, run the installer, and verify with dotnet --version in cmd.
Install Visual Studio Community edition, select the ASP.NET Core development workload, and optionally explore Visual Studio Code for building minimal APIs with ASP.NET Core 9 and EF Core.
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.
Install SQL Server Developer Edition and SQL Server Management Studio, then connect with Windows Authentication to create databases, create tables, and run queries.
Install postman to send http requests to your web api and practice get, post, put, patch, and delete methods, while configuring settings to disable cache and SSL certificate verification.
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.
Create a web api using the dotnet CLI, select web template and minimal apis movies folder, then open the project in Visual Studio Code with the C# Dev Kit extension.
Explore the solution and project structure in Visual Studio, including csproj definitions, non-null reference types, implicit usings, and the role of NuGet packages and class libraries.
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.
Configure development launch settings in launchSettings.json by selecting IIS Express or Kestrel, set the running port, define a default launch URL like swagger, and use environment variables to indicate development.
Learn how appsettings.json and appsettings development json act as configuration providers to manage environment-specific data, including environment variables and connection strings, without hard coded values, using builder.configuration to retrieve values.
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.
Define a genre entity with id and name, implement a minimal API endpoint using app map get, and return an in-memory list of genres (drama, action, comedy) as JSON.
Install dotnet, Visual Studio, and tools to perform exercises; create a web api, learn project vs solution, and configure launch settings, app settings, and the program endpoint.
Apply Rest principles to an ASP.NET Core Web API to build a professional, standards-driven application.
Understand client-server separation and how cross-origin resource sharing (CORS) enables web APIs to be consumed from different origins, with origin defined by scheme, host, and port.
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.
Learn how to enable cors in ASP.NET Core by configuring services, setting a default policy with allowed origins, headers, and methods, and reading origins from appsettings.json.
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.
Learn why not using state in a web API improves scalability by ensuring every HTTP request carries all data, avoiding server sessions, and using JSON web tokens for user info.
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.
Explore a macro-level layer system that keeps web API, database, a file storage service, and a Redis cache server as independent components. We'll develop these layers throughout the course.
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.
Continue developing our application by creating a database from C code and performing create, read, update, and delete operations in a chroot, all using Entity Framework Core.
Explore the fundamentals of databases, showing how a database stores and persists information with tables, rows, columns, and data types, and how operations run through SQL server and web API.
Represent database tables as objects using Entity Framework Core, an ORM that abstracts SQL behind functions, enabling cross-platform access to SQL Server, SQLite, PostgreSQL, MySQL, Oracle, and Cosmos DB.
Track the annual November releases of Entity Framework Core and understand long-term support timelines for LTS versus non-LTS versions to guide stability decisions.
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 the Entity Framework Core CLI to run EF Core commands, compatible with Visual Studio or Visual Studio Code, and resolve dotnet tool issues for a stable setup.
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.
Define genre entity and map it to a genres table with Entity Framework Core by adding a DbSet<genre> to the application db context, detailing id and name, and plan migrations.
Use migrations to translate C# code changes into database updates, creating a genres table with id and name. Learn how to add migrations in Visual Studio or net CLI.
Configure columns in EF Core by convention, data annotations, and fluent API, including setting a name column to max length 150 and applying migrations to update the database.
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.
Clean and evict cached genre data by tag using the output cache store, then verify new data appears after creation before subsequent requests rely on cached results.
Order genres by name using order by to sort results in ascending order. Toggle to order by descending to display science fiction, drama, comedy, and action.
Create a put endpoint to update a genre by id, validating existence via the repository and clearing the cache after updating using EF Core.
Delete a genre by id through a map delete endpoint, using a genres repository and EF Core to remove the record and return a 204 no content.
Learn to organize minimal APIs with map group to define a base configuration for all genres endpoints, reducing repetition and enabling a single place to update.
Refactor an ASP.NET Core minimal API from lambda expressions to named methods to improve readability by encapsulating each endpoint in a static method and using type results for Swagger.
Organize a minimal API by grouping endpoints into a genres endpoints class, using an extension method to map a route group and enable Swagger grouping.
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.
Persist information permanently in a database using EF Core to create a database from C code and perform crud operations, while organizing the web api for a manageable program class.
Continue performing CRUD operations on actors, movies, and comments, and configure one-to-many and many-to-many relationships to model connected entities in a minimal API context.
Create the actor entity and actors table, configure name to 150 characters, store the picture URL as non-unicode via the EF Core fluent API, and apply the migration.
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.
Create actor dto and actor dto with automapper; build a minimal api endpoint accepting from form data with a nullable picture, returning the created actor url.
Explore storing images in a minimal ASP.NET Core 9 API using a flexible file storage interface that supports Azure or local storage, with store, delete, and edit operations.
Create an Azure storage account and resource group to enable file storage, and implement a blob storage client to upload files with unique names and content types.
Implement a local file storage service to save uploaded files under the web root and expose their URL via HTTP context, environment info, and static files middleware.
Implement endpoints to get all actors or an actor by ID using a repository, Automapper to map to actor DTO, and caching with not found handling.
Learn to implement server-side name filtering for actors in a minimal api using where and contains, with an ordered get by name endpoint and database-driven filtering.
Implement pagination in ASP.NET Core 9 APIs by building a pagination DTO with page and records per page, cap at 50, and apply it to the actors endpoint.
Implement reusable pagination in a minimal api using http context extensions and a queryable, returning total records in the response header while using skip and take for actors and movies.
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.
Implement a delete endpoint for actors that removes the database record and its picture, updates the cache, and returns 404 for missing actors and 204 no content on success.
Create the movie entity as the central hub linking genres, actors, and comments, with id, title, in theaters, release date, and a poster. Apply migrations to create the movies table.
Build a movies repository for a minimal API with CRUD and pagination, using a queryable context, pagination headers, and get by id, create, update, delete, and exists methods.
Implement a minimal api endpoint to insert movies from form data, including data transfer objects for create and read, automapper mapping, poster storage in a movies container, and repository persistence.
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 put endpoint to update movies by id, mapping a create movie dto to a movie entity, updating the poster via file storage, and refreshing the cache.
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 repository with the application db context and EF Core, implementing get all by movie id, get by id, create, update, delete, exists, plus interface and program registration.
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.
Update and delete comments via new endpoints in a Visual Studio ASP.NET Core 9 and EF Core setup, with existence checks, mapping, and cache refresh.
Fetch a movie with its comments by using include on get by id in the movies repository, and update the movie dto to display the associated comment list.
Establish a many-to-many relationship between genres and movies using an intermediate table, define a composite primary key, configure navigational properties, and run a migration to update the database.
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.
Assign actors to a movie by updating the movies repository with an automapper mapping, loading related actors, setting order, and saving changes in EF Core.
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.
Learn to fetch a movie by id with its genres and actors by using include and then include, map data to genre and actor dtos, and verify results in swagger.
Order related data in a movie API by using include with order by for actor sequencing. Validate changes in swagger and Visual Studio; verify the endpoint reflects the configured order.
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.
Learn to implement validations and robust error handling as you ensure client requests meet business rules while preserving a smooth user experience in the face of any errors.
Validate user input in minimal APIs with FluentValidation, install the library, and configure validators in the program class to enforce synchronous and asynchronous rules for business data.
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.
Apply multiple validations to a single property by enforcing a not-empty rule and a maximum length of 150 characters, with a customized error message for name length.
Learn to implement a custom validation in a minimal API, ensuring a string starts with an uppercase letter and returns true for null or whitespace, using must for the rule.
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.
Create a static validation utilities class to centralize common messages and logic, reusing non-empty, maximum length, and first letter uppercase validations across genre and actor DTO validators.
Use endpoint filters to centralize validation logic for parameters in minimal apis, with a test filter implementing the endpoint filter interface applied to a get by id endpoint.
Discover how to access endpoint parameters in a filter by position and by type in ASP.NET Core 9, avoid parameter order issues, and prepare for validation with typed context arguments.
Implement a validation filter that retrieves a validator from the inversion of control container to validate the create genre dto before endpoint runs, and return a validation problem if invalid.
Implement a generic validation filter for any DTO using the endpoint filter interface, applying it to the genres and actors endpoints and verifying validation via swagger and postman.
implement comment validations by adding a comment dto validator (inheriting from abstract validator) and applying non empty body rules to create and update endpoints, ensuring 400 when body is missing.
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.
Learn to handle data type validation errors in minimal APIs by returning structured JSON errors with status codes using problem details, exception handling, and status code pages.
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.
Store production errors in a database table using a globally unique identifier, and capture the error message, stack trace, and date time.
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.
Explore security in web api by implementing a user system that assigns permissions so each user can or cannot perform specific actions.
secure minimal apis with authentication and authorization in asp.net core 9 using identity and json web tokens; learn to issue and validate jwt, manage claims, and enforce admin-only access.
Protect endpoints in ASP.NET Core 9 API by configuring authentication and authorization with JWT Bearer. Learn to add middleware, install the JWT package, and test secured endpoints with swagger.
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 identity in ASP.NET Core 9 by installing ASP.NET Core Identity EF Core package, defining users and roles tables, and wiring user and sign-in managers for web API login.
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.
Securely retrieve the current user's id in an ASP.NET Core 9 app by reading the email from the JWT via HttpContext, then use UserManager to fetch the IdentityUser.
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.
Configure a claim-based policy named is admin requiring an admin claim, apply it to admin-only endpoints (post/put/delete) for actors, genres, and movies, and test token authorization.
Assign a customized admin claim to users using a new endpoint and the users claims table, validating emails and updating JWTs upon re-login for admin authorization.
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.
Identify how authentication verifies identity and authorization controls access; protect endpoints with JWTs and enable user accounts and login to interact with a web API across apps.
Felipe Gavilan introduces the module, outlining new scenarios not yet covered, and previews topics like logging, model binding, and deeper Swagger exploration.
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.
Master model binding in asp.net core 9 minimal APIs by binding parameters from query strings, headers, the body, route values, forms, and injected services.
See how the as parameters attribute consolidates multiple endpoint inputs into a single DTO, apply it to get genre by id, and review validation filter limitations.
Bind async demonstrates binding a pagination DTO in minimal APIs by reading page and records per page from the query string and mapping values.
Install the OpenAPI NuGet package and add a pagination parameters extension to expose page and records per page in Swagger.
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.
Configure swagger to send jwt by adding a security definition and security requirement for a bearer token in the header, enabling authorized endpoints.
Implement a swagger authorization filter that inspects endpoint metadata to apply OpenAPI security only to endpoints requiring authentication, such as post actors, while get actors stay unauthenticated.
Develop a movies filter DTO and an endpoint to filter by title, genre, and future releases, with in theaters status and ordering by field, wired to a repository and mapper.
Build dynamic movie filters using EF Core's deferred execution by composing a queryable, conditionally applying title, in theaters, future releases, and genre filters, then paginate and execute async.
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.
Define an enum for the order by field (title or release date) and update the open api ini to enforce these Swagger options.
Learn to implement a distributed cache with Redis, enabling a shared cache across multiple API instances and options like a local Redis server or Azure Cache for Redis.
Install and configure a free cloud Redis server, obtain a public endpoint and credentials, then connect to Redis from .NET Core for testing minimal APIs.
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.
Explore REST limitations like overfetching and underfetching in web APIs, and learn how a single flexible endpoint using GraphQL lets clients request exactly the data they need.
Explore GraphQL as an API language that uses a single endpoint to handle queries and mutations, weighing caching, performance, and real-time capabilities against rest.
Install and configure GraphQL in an ASP.NET Core app with Hot Chocolate and EF Core, enabling authorization, paging, projection, filtering, and sorting, and expose a genres query.
Explore testing GraphQL and using the schema to query genres and movies, select id and name, order by name, first three results, and filter with where and contains.
Enable actor and movie queries in your minimal API project, exposing actors with id, name, and date of birth and movies with title and comments, using Swagger in Visual Studio.
Learn how to mutate data with GraphQL by implementing a mutation type to insert, update, and delete genres using a repository, automapper, and a create genre DTO.
Authorize access to GraphQL resources using hot chocolate and an admin policy, then test the flow with a jwt-based authentication.
Explore simple locking in ASP.NET Core, compare model binding options such as parameters and bind async, and implement Swagger documentation, RedisAI-based distributed caching, and GraphQL for flexible data requests.
Publish your web API so clients can access it by deploying to Azure and IIS. Use Azure DevOps to implement continuous delivery for streamlined deployments.
Publish a minimal API to Azure App Service, configure Azure SQL database and connection strings in appsettings.json, and apply EF migrations on publish to ensure production readiness.
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.
Install the hosting bundle to publish a .NET core API to IIS, configure appsettings.json for production, create a SQL login, publish from Visual Studio, and run the site with swagger.
Configure continuous integration and continuous delivery with Azure DevOps and GitHub to automate compilation, testing, and production deployment of your application.
Publish minimal APIs to an Azure app service via Azure DevOps by configuring a CI/CD pipeline that builds with .NET 8, generates EF migrations, and publishes artifacts.
Create and deploy a continuous delivery pipeline in Azure DevOps, triggering releases from CI, deploying to Azure App Service, applying database migrations, and validating updates in production.
Publish your API by deploying to Azure App Service or IIS, while Azure DevOps standardizes updates from GitHub to production.
Celebrate finishing this course and apply its insights to your professional life, then look forward to the next course.
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.