Загрузка...

.NET Core Web API CRUD with PostgreSQL and Entity Framework Core

In this video we are going to learn, how to create REST Apis in .NET 9 with Postgres database. It is going to be a perfect tutorial for beginners who are just starting out. In this tutorial we learn:

- How to create web apis in dotnet 9 from scratch
- How to create dotnet REST APIs with postgres database
- Dotnet REST API CRUD using Entity Framework core.
- How to spin up Postgres using docker
- How entity framework methods actually work

I have tried my best to explain every little detail about creating dotnet rest apis. However, there might be a possibility that something is missed or something got confusing. It that happens then feel free to ask me anything in the comment.
💻Source Code: https://github.com/rd003/DotnetPgDemo

⌨️⌨️ postgres docker

⌨️ 1. Pull docker image of postgress

docker pull postgres:16.9-bullseye
⌨️ 2. run the container

Note: This command works only on bash/GitBash because of \ symbol, which is a next line symbol in bash. For windows powershell you need to replace '\' with ` (backtick)

docker run --name pg-dev \
-e POSTGRES_PASSWORD=p@55w0rd \
-p 5432:5432 \
-v pgdata:/var/lib/postgresql/data \
-d postgres:16.9-bullseye

⌛ Chatpters:

(00:00:00 - 00:03:46) Tools needed
(00:03:46 00:07:46) Creating a new web api project
(00:07:46 - 00:08:13) C# dev kit
(00:08:13 - 00:10:45) Understanding the project structure
(00:10:45 - 00:14:14) WeatherForecast controller
(00:14:14 - 00:15:11) .http file and rest client extension
(00:15:11 - 00:22:33) Spinning up the postgres in a Docker container
(00:22:33 - 00:24:18) Ways to connect with database
(00:24:18 - 00:27:44) Required nuget packages
(00:27:44 - 00:30:20) AppDbContext
(00:30:20 - 00:32:23) Person.cs (model)
(00:32:23 - 00:33:36) DbSet
(00:33:36 - 00:40:36) Registering AppDbContext and connection string
(00:40:36 - 00:46:47) Creating database using Migrations
(00:46:47 - 00:50:27) PeopleController and injecting AppDbContext
(00:50:27 - 00:57:44) Post endpoint
(00:57:44 - 01:00:21 GetAll Endpoint
(01:00:21 - 01:03:34) Get (by id) endpoint
(01:03:34 - 01:06:34) Returning 201 CREATED from a POST endpoint
(01:06:34 - 01:13:02) Update endpoint
(01:13:02 - 01:16:18) Delete Endpoint

🔖Other links:
▶Code Crunch (precise c# .net videos): https://www.youtube.com/playlist?list=PLP8UhDwXI7f8AqaxdNh98lvAeqktu9bEa
▶Single video courses: https://www.youtube.com/watch?v=e2I7EzuCt1g&list=PLP8UhDwXI7f-IFqwrx89QN1QIurYr94-p&ab_channel=RavindraDevrani
▶dot net 6+ tutorials and projects: https://www.youtube.com/playlist?list=PLP8UhDwXI7f_-5Swp8DlNa6wD15e1JYrU
▶Learn projects from scratch: https://bit.ly/3zpn9ng
▶Dotnet with different databases: https://www.youtube.com/playlist?list=PLP8UhDwXI7f-dOqUH2T2qrdQ1Ow5J6Ap_
▶Authentication and authorization: https://www.youtube.com/playlist?list=PLP8UhDwXI7f9Mcx3Q7yd7faJWBNRhjeJM
▶Design patterns with c#: https://www.youtube.com/playlist?list=PLP8UhDwXI7f8V4BgVJ97qMMA29Sd9H8Vz
▶Practical Oops with c#: https://www.youtube.com/playlist?list=PLP8UhDwXI7f8VDcivJiMkbAZCarj-VWnw
🌟 Connect with me:
👉 Blog: https://ravindradevrani.com/
👉 YouTube: https://youtube.com/@ravindradevrani
👉 Twitter: https://twitter.com/ravi_devrani
👉 GitHub: https://github.com/rd003

☕Support my work:➡️ Buy me a coffee 🍵: https://www.buymeacoffee.com/ravindradevrani

#restapis #aspnetcore #entityframeworkcore #dotnet #csharp #programming

Видео .NET Core Web API CRUD with PostgreSQL and Entity Framework Core канала Ravindra Devrani
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять