How to Setup a Minimal API in .NET 7

Published: 01 January 1970
on channel: Code with Julian
4,224
135

In this tutorial we'll take a look at how to configure a minimal api in .NET 7. We'll also take a look at the Minimal API filters, added into .NET 7 and how to properly set them up.

🎁 Final Project (source code) and Postman Instructions 👉https://resources.codewithjulian.com/...

📝 Written article: https://codewithjulian.com/setup-mini...
👉Join our email club: https://signup.codewithjulian.com
🎉Check Out Further Resources: https://codewithjulian.com
👍If you enjoyed this tutorial, please like this video consider subscribing for more content like this!
😎Subscribe for endless .NET Tutorials:    / codewithjulian  

😮 By the end of this tutorial, you will be able to:
Setup a Minimal API in .NET 7
Create Minimal API CRUD endpoints
Install and configure FluentValidation
Understand API Filters and how they work
Configure Minimal API filters for an enterprise level application

🖊 Useful Notes:
Versions used in the recording of this tutorial:
.NET SDK: 7.0.100-preview.4.22252.9
.NET Runtime 7.0.0-preview.4.22229.4
Visual Studio 2022 17.3.0 Preview 1.1
To generate the migration using EF Core Tools, use the following command in your Package Manager Console in Visual Studio:
👉 Add-Migration InitialCreate -c MarketMgrDbContext -o DataAccess/Migrations
To update the database with a generated migration:
👉 Update-Database InitialCreate

📦 Dependencies:
👉 FluentValidation.AspNetCore --version 11.0.2
👉 Microsoft.EntityFrameworkCore.SqlServer --version 7.0.0-preview.4.22229.2
👉 Microsoft.EntityFrameworkCore.Tools –version 7.0.0-preview.4.22229.2

0:00 - Intro
00:30 - Setup a New Minimal Web API
01:30 - Setup and Configure SQL Server Database
04:22 – Create and Apply SQL Server Migrations
05:29 – Create Minimal API Endpoints
09:34 – Setup Fluent Validation
11:51 – Configure Minimal API Endpoints Filters
15:11 – Refactor Route Handler Filters

🥇 Credits:
Sound effects obtained from https://www.zapsplat.com
Icons created by the designers at freepik.com and flaticon.com
Images from the artists on unsplash.com


Watch video How to Setup a Minimal API in .NET 7 online without registration, duration hours minute second in high quality. This video was added by user Code with Julian 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,224 once and liked it 135 people.