REST API with .NET 6 Guide | Entity Framework Core | Fluent Validation | API testing with Postman

preview_player
Показать описание
By popular demand, here it is:
Video step-by-step walk-through to creating a REST API with .NET 6.

The video is divided up into micro-sections with a timestamp and title.
(see the info for all timestamps)

Contents:
A beginning-to-end video demonstrating how to set up a REST API with .NET 6.0 Web API using Entity Framework Core, Fluent Validation and API testing.

Featuring:
HTTP method types included: GET and POST.
1 Entity with primary key for Entity Framework setup.
3 Projects (Infrastructure, Entities, API) in 1 solution.

Source code:

Timestamps:
00:00 What we're going to build (with illustration)
00:55 Requirements (what to install)
03:05 Creating an empty solution
04:01 Creating the default API project (weather forecast)
06:38 Testing connectivity to API
08:15 Deleting the default bloat we don't need
08:40 The starting point file
09:00 Creating a new controller
11:00 Requesting a new hello world endpoint
11:42 Creating "infrastructure" class library
13:05 Creating "entities" class library
15:00 Adding "entities" as a dependency for infrastructure
15:44 Adding Entity Framework Core as infrastructure dependency using NuGet package manager
17:15 Adding "infrastructure" as dependency for API
19:00 Creating DB Context
23:05 Creating Product Repository
24:53 Making EF query: Get all products
26:05 Making EF query: Insert new product
27:16 Creating a database file for SQLite
28:05 Making Repository function to ensure DB is created
29:16 Creating a path for the database
32:05 Creating a constructor for Controller with Repository dependency injection
33:20 Making sure the controller can get instance of repository
33:48 Changing the HTTP GET endpoint to get all products
34:30 Making endpoint for triggering ensure DB created function
35:50 Adjusting routes so endpoints are not the same
36:16 Calling Ensure db created + Get All Products
37:17 Creating POST endpoint in controller
41:35 Adding Fluent Validation NuGet package
43:50 Creating the ProductValidator
46:55 Using the ProductValidator
49:40 Changing endpoint return type for CreateNewProduct to ActionResult
51:55 Sending a request rejected by validator
53:15 Introduction to API testing with Postman
54:10 Testing status codes
58:23 Running several requests with tests using collection test runner
Рекомендации по теме
Комментарии
Автор

thanks a lot, it make more sense now than before :D

samkaxe
visit shbcf.ru