
Build lightweight, endpoint-first apis with dotnet six for microservices and cloud-native apps. Learn practical patterns in entity framework, dependency injection, dto shaping, versioning, and security with scalar ui documentation.
Learn why minimal APIs offer fast, boilerplate-free endpoints for microservices and small back-end services, with superior performance and beginner-friendly clarity backed by entity framework and scalar tools.
Create a minimal API starter by building a new ASP.NET Core web API in Visual Studio 2026, select dotnet 10 and decide whether to use controllers or program.cs for configuration.
Compare minimal api with a standard api by showing how minimal api uses a single program.cs and lacks controllers, map controllers, and services add controllers, with no authorization by default.
Create a minimal api in dotnet core using program.cs and appsettings.json, configure the builder, add open api, and run a demo endpoint returning summaries through a https redirect pipeline.
Explore api basics, including what is a request, what is a response, and the core http verbs such as post, put, batch, and delete, laying the fundamentals for minimal api.
Discover how an api, the application programming interface, enables data sharing among web, mobile, and other applications by handling requests and responses via a server.
Learn how a client and server exchange http requests and responses, using verbs like post, headers, and content, with status codes like 201 created, while servers stay stateless.
Explore the request object in REST APIs, including common http verbs (get, post, put, patch, delete), headers like content type and authorization, and the role of content in requests.
Explore the response object in a minimal API, learn how status codes—from informational 100 to 199 to success 200–299 and errors like 404 and 500—signal results, with headers and content.
Explore how http verbs define api actions, including get for listing coupons or a single coupon by id, post for create, put for update, and delete for removal.
Install scalar.aspnetcore to enable scalar v1 API documentation and automatically launch the browser, then configure the debug launch profile to redirect to scalar v1.
Create a hello world get endpoint in program.cs using map get with the route /Hello World that returns Hello World in minimal API, and test it with tester.
Design minimal api endpoints in .NET Core that return multiple result types using Results, handle exceptions, and explicitly specify status codes like 200 and 400.
Define and validate route parameters in a minimal api by passing an id through the route and enforce the id as an integer, returning 404 on mismatch.
Install and configure Microsoft Entity Framework Core with SQL Server, define a category model and a categories DbSet, and register the db context in program.cs. Add a connection string in app settings, create migrations, and update the database to create the categories table.
Seed the category table with model builder has data and a static date, create a seed category migration, update the database, and implement crud endpoints for category in minimal API.
Learn to build a minimal api endpoint to fetch all categories using Entity Framework and dependency injection with the application db context.
Learn to convert a categories retrieval endpoint into an asynchronous endpoint by adding the async keyword and using await with the application DB context.
Retrieve a single category by id using a restful get endpoint, inject the database context, perform an async lookup, and return the category or a 404 not found response.
Create a category via a post endpoint that accepts a category object from the request body, automatically sets the added date, saves changes asynchronously, and returns the created category.
Enforce basic validation on a minimal api post endpoint by requiring a non-null category name and returning a bad request when missing, and introduce data annotations in dotnet 10.
Learn to add data annotation validations to a minimal api in .NET Core, including required fields and string length, enable problem details responses, and handle validation errors consistently in json.
demonstrates returning a 201 created result for a post endpoint by providing the resource's location URI in the response header and the created item, using the id in get endpoint.
Define and use named endpoints in minimal api to assign unique names to get routes such as get category by ID and get all categories.
Enhance minimal api documentation by specifying accepts and produces for endpoints, including json content types, status codes, and problem produces for robust open api docs.
Bind complex types from the request body by default in Minimal API, while simple types bind from route or query and the framework infers the binding source.
Explore injecting multiple dependencies in minimal API with .NET Core, including db context and a logger, and follow best practices for route or query parameters, body, and service injection order.
Expose only DTOs instead of core entities to avoid revealing sensitive data, and create category create DTO, update DTO, and category DTO for create, update, and retrieve operations in program.cs.
Apply a category create DTO in the create endpoint, converting it to a category entity and then back to a category DTO for the response, avoiding exposure of core entities.
Learn how AutoMapper simplifies mapping between category models and DTOs, including create and update DTOs, with reverse mapping and ignoring the ID and edit date properties.
Move category endpoints into a dedicated endpoints file and expose them via an extension on the endpoint route builder. Update program.cs to register the extension and run the app.
Extract inline handlers into dedicated methods to organize endpoints for get all categories, get category by id, and create category with an injected app db context.
Refactor endpoints to use api grouping by creating a category group and mapping all category endpoints with a shared api/categories route and a categories tag.
Implement update and delete category endpoints in a minimal API using route IDs, a category update DTO, automapper, and EF Core, returning 200 on success or 404 when not found.
Create a uniform API response by implementing a standard response model with four properties—success, result, status code, and errors—and apply it across all endpoints.
Standardize .NET minimal APIs with a single API response type across endpoints, using 200, 201, 404, and 400 status codes, and expose category data only through a DTO.
Fixes the delete endpoint by ensuring an ID is supplied, tests deletions with IDs 4 and 6, and confirms the database reflects the deletions, with 200 responses.
The lecture shows adding authentication to a minimal API by creating a local user table with admin and customer roles, a static details class, and migrations.
define login and registration endpoints with request and response DTOs, including login request DTO, registration request DTO, and login response DTO that returns a JWT token and default customer role.
Create an auth endpoint group with login and register post endpoints, validate registration data, map to a user entity, use Entity Framework to save, and return a standardized API response.
Debug and refine the minimal API registration flow by mapping the authentication endpoint in program.cs, testing admin registration, and ensuring the admin role is assigned for new users.
Implement a login endpoint that validates user credentials and returns a JWT token using the API settings secret, with seven-day expiry and a login response including token, email, and role.
Explore how to enhance JWT tokens by adding user claims such as name, email, and role, using a claims identity and built-in claim types to drive secure access.
Enable authentication and authorization for the minimal API by applying require authorization at the group level and wiring authentication before authorization with jwt bearer tokens validated by a symmetric key.
Log in to obtain a token, then pass it in the authorization header to access secure endpoints and avoid 401 unauthorized; use swagger document transformer to streamline authentication.
Modify scalar docs by configuring a document transformer to add a jwt-based security scheme and global open api security, enabling token authentication in scalar ui.
The lecture demonstrates implementing role based authorization in minimal API by securing create and delete category endpoints to admin only, while customers can read, using required role and tokens.
Practice building a minimal api for menu items with full CRUD, including db migration, dto mapping, and seeding, while postponing image upload and removing authorization.
Build minimal API endpoints for menu items in .NET Core, enabling CRUD, include category data with EF Core, and map to menu item and category DTOs with AutoMapper.
Develop and test create, update, read, and delete endpoints for menu items in a minimal .NET Core API, validate category IDs, and verify seeded data and routing.
Define a custom category id validator by inheriting a validation attribute, using the validation context to access the db context, and validating category existence on menu item create or update.
Watch custom validation in action as the application flags an invalid menu item, showing a category ID does not exist error and confirming the validation works as expected.
Implement a minimal api file upload by creating www root/images and enabling static files. Use IFormFile in a dedicated endpoint, rename the image to the item id, and save it.
Implement an async save image file function with extension validation, save to wwwroot/images/menu items, replace existing files, and return a three-part result for a minimal API endpoint.
Explore uploading an image in a minimal .NET core api by refining the post endpoint to include an id and an image route, then test with multipart form data.
Implement versioning by creating v1 and v2 endpoints for categories and menu items, update namespaces to v2, and expose get endpoints with dummy v2 data.
Implement versioning in a minimal API by adding ASP.NET versioning packages, configuring an API versioning middleware, and applying v1 and v2 to endpoints via map to API version.
Configure api versioning in services with builder.services.add API versioning, set default version to 1.0, enable version reporting and API Explorer, and substitute the version in the URL.
Learn to load multiple OpenAPI documents for versioned minimal APIs by iterating over versions, setting version and display names, and registering v1.0 and v2.0 with shared security settings.
Create an API version set to manage v1.0 and v2.0, enabling correct routing and header reporting, then register and map v2 endpoints alongside the existing ones.
Set up and consume a version set in minimal APIs by linking route groups to an API version set, enabling version validation and routing to version 2 across endpoints.
Configure the version set for endpoints, as only group metadata inherits, causing endpoints to expose v1 and v2; revert by applying constraints to each endpoint and enable scalar UI toggle.
Explore versioning in action within a minimal API, enabling a dropdown in the scalar API reference to switch between v1 and v2 OpenAPI documents via the API version description provider.
API has been there since a very long time but microsoft has recelty introduced something new "MINIMAL API"
Minimal API is a short form of standard API and there are very good reasons on why you should learn it and why it would be preffered over API in some scenarios.
In this video we will explore everything about Minimal API, as we first answer the big question "WHY MINIMAL API?"
By the end of this course, you will be able to build a endpoints with minimal API by yourself, make GET, POST, PUT and DELETE HTTP Requests with a well-built repository pattern in .NET Core.
What are the requirements?
3-6 months knowledge of ASP.NET Core.
Visual Studio 2022
SQL Server Management Studio
.NET 7
All source codes and exercise solutions of this course are also available on Github and you can find details in the lecture "PROJECT RESOURCES", of course.
I always strive to keep content latest and with top quality content! You will start from ground zero and build a complete API with advance concepts like authorization, authentication, filters and much more!
This will be a hands on course with programming, so lets get started and learn the new and exciting world of Minimal API.