.NET 8 Web API & Entity Framework 🚀 Full CRUD Course (with Code-First Migrations & SQL Server)
Вставка
- Опубліковано 22 лип 2024
- 🚀 Join the .NET Web Academy: learn.dotnetwebacademy.com
💖 Support me on Patreon for exclusive source code access: / _patrickgod
🐦 Let's get social on Twitter/X: / _patrickgod
🔗 Let's connect on LinkedIn: / patrickgod
Table of Contents:
00:00 - .NET 8 Web API & Entity Framework
01:07 - Starting Off: Creating the Web API Project
02:43 - Exploring the Project: Detailed Project Overview
06:54 - Data Modeling: Creating the Entity Class
08:01 - API Basics: Adding an API Controller
17:13 - Database Integration: Adding Entity Framework & SQL Server Database
26:43 - Migration Strategies: Implementing Code First Migrations
32:05 - Controller Implementation: Detailed Step-by-Step Guide
35:30 - Retrieving Data: How to Get a Single Entry
38:49 - Data Creation: Using POST to Create New Entries
44:19 - Data Update: Modifying Data with PUT Method
48:30 - Removing Data: Implementing the DELETE Method
#DotNet #WebAPI #AspNetCore
Thank you so much! I struggled for 2 days finding full complete tutorials on creating a full CRUD web API and your tutorial helped so much. Learned about the syntax and what tools to use!
since morning i stucked with some errors/exceptions after coming here i got the solution
thank you so much for a great course
6:19 Well yeah, REST is very well standardized. Great tutorial!
This is such an onpoint video. Amazing work !
Fantastic lesson. You are helping understand this so well!! Thank you so much!
You reached a level of trust for me that, i like the video before i start watching it, and at the end i think with my self, "yes, i knew it".
Congrats for your content, and hugs from Brazil to you, honestly, your channel is the most recommended by me for my friends! Even those who doesn't speak english hahahahaha
Wow, thank you so much! Really appreciate that!😊
Thanks for the tutorial man, it was absolutely helpful appreciate it.
Thank you very much for the video tutorial, it became much clearer. It’s a pity that they didn’t use DTO as an example and didn’t break it down into services. I'm waiting for new videos
Absolutely spectacular tutorial. Thank you.
You're very welcome! Thank you!
Thanks for the tutorial., it was absolutely helpful. I appreciate it
This video saved me tooo much. Thank you
Very good video! Thank you for your help and time!
Danke Für das toll Unterricht
This is a great guide for learning.
I loved how you guess my thoughts in the minute 40:30 about the "List"😆
Thank you so much for making this video!
Very good video! Thanks!
thanks man
refreshed my knowledge
Will Be great to see an example using CRUD and modal popup dialogs
This video is amazing, thank you so much!!!!
It's just amazing course for beginners. Good job!
Thank you! Appreciate it. 😊
Amazing video, it helps a lot
Hey Patrick great video, I know most of the stuff you do on Blazor is WebAssembly, is it possible you could do a video on how to add single account identity to a project that you configured without it at project creation, and you already have a database with a connection string?
Thanks,
Jordan
Hi Patrick, would appreciate if you make a video on Blazor server and controller API in one project using dapper generic functions.
Thanks for this video Patrick.
My pleasure!😊
Hey , i saw error while scaffolding DbContext using CLI , it is possible to do it in .net 8 ?
Great tutorial BUT the add row flow doesn’t work if the table has a primary key that’s auto-increment for unique ID. How would you alter the code to support an auto-increment primary key?
2:09
my visual studio show .net 8 preview only
how can i add .net8 lts version?
Hi thanks for this video.
I have a question...
I attach a breakpoint in my code but they never hit. Why? And how can ich fix it,
Great video. Thanks a lot.
absolutely amazing content
Which machine are you using for the development and video production?
Thank you. Be great if you could do the Database-First implementation whenever you show the Code-First implementation.
I think it's related but not necessary. Database-First is used on existing database model to convert it to classes, useful when migrating application, e.g. .Net 7 apps to .Net 8
How do i connect to a mysql database ive made with docker ? What's the connection string ?
Thank uou guy, for this fantastic video.
excelent. Great tutorial
i preciated for your works
is there any sample if using existing DB with .NET 8
Man this is insane, thanks, so much thanks i love you.
Glad I could help😊
Great Video!
what server do you connect to in sql server studio?
I went to the Academy link, but it didn't show any courses available. :(
Which line of code here automatically increments the id? not in migration.
Thanks bro!
Thanks for explaining the .http file deleted without knowing what was for lol. But swagger and postman are still the winners.
Do you know why I’ve really often the message : attempting to reconnect to the server ?
Really good 👍🏻
When update why not return the Hero that is being updated instead of full list of heroes. How can I do it? Great Video to learn the CRUD operations .NET 8 tahnk you!!
Amazing, thank u sooooo
Thanks a lot!
how migration will be happened in Staging and prod env
awesome content
can you provide command used to create project in vs code
thx for this cool course
Youre the best!
47:00 i think that you are not using the improved that EF 8 includes like Bulk Updates
thanks!
How EF Core [8] is different from .Net [8] ?
Maybe explain in another video the difference and purpose of each.
Thanks.
hello patrick i have a question if i know how to make Web API does it count as backend developer? i mean does that means that i am a backend? (Also nice video and good luck
thank you
Clear and beautiful as usual. Thank you for sharing! I might ask my boss to pay me for the academy, but I don't know if they will agree :D
Please do! 😜
Great Video! you said that you wouldn't inject the DataContext in the controller, but instead inject the "Service" into the constructor of the controller?
For SQLServer, i'm guessing you would inject the db service in the program.cs file as a AddScope injection?
and then use it to access the db in all your controllers?
It's a great practice to handle DataContext using Interface/Service rather than declaring it in the controllers so when the DataContext changes, you only make changes to the construct of the Interface/Service (meaning you only change it in a single location, instead of modifying all the controllers that is using the same context).
Hello
Thank you very much for your videos.
If possible a tutorial on.
Custom authentication from scratch.
Use of Tokens & Cookies.
and put Claims authentication on the server and client side.
Thank you very much.
Thanks!
Thank YOU! Very kind of you! ❤️
It would be a God-send (see what I did?) if you could do a video on implementing Single Sign-On / multiple apps sharing authentication in Blazor. I'm struggling with this right now and it seems a lot of other people are too.
Hi Patrick, great turorial, thanks! However... when this is published to a folder for local IIS it returns a 500 error :/ any idea why? I've scoured the internet and there doesn't appear to be a solution.
By sending more explanations, we can solve this error, but I'm sorry. be solved like this
in the file
appsettings.json
instead of local IP
Replace the domain address
min 34:20 he just say " Pay attention here" *PAM, ADVERTISMENT* such a humor sense xDD
Hi Patrick, do you have theoretical written study material in your .net paid course?
I'm interested because I don't know English well and I can't understand your speech well
At time 46:49, what keystrokes did you use to multi rename hero to updateHero? Ah.. control r twice , I never used that .. very cool.
Ctrl+R+R - Enjoy! 😄
@@PatrickGodnanu nanu
I need exmble with ado and combobox
De los mejores
can you create a playlist with all .NET 8 videos
Here it is: ua-cam.com/play/PLF1jhYUTnHo4xzSbrznUEAsIl7upw3X7K.html Enjoy! ❤
Please make video about graphql... With authorization
Would you have any link to an example of the "proper" way you mentioned to do the controller please? Instead of the "fat controller". I'm new to .NET and don't know how to google what you said.
Hi David. The term you're looking for is "Repository Pattern". You'll find relevant documentation if you Google "Repository Pattern" and "Entity Framework" together.
keep going
great
you are GREAT
YOU are great! 😊
@@PatrickGod
Sir Plz Can you Create an ERP system 🙂
can you make a video .NET 8 web API connecting with oracle SQL Developer?
Quick question.. What is the main purpose for the migration?
Will it be still needed if i create a database tables on SQL directly?
Do you have any article regarding the migration
Thanks..
Data migration's main purpose is to create the database structure using the entities (tables) you have created, and apply all the changes to your database every time when you made changes to your entities.
Meaning when the entities change (you added a new entity, you changed a column name in an existing entity, or you changed the column type), data migration will see these changes and will create a migration script (when you use the add-migration command) that will match the changes when you use the update-database command.
Data migration keeps track on the changes you make on your code, and matches the structure of your database. As your app grows, your tables grows, and you don't need to manage it thru your SSMS (which is a great headache later on in production).
what previous knowledge or skills should i have to watch this course I am new and I just finished a c# fundamentals course
please reply😊
I suggest you check the title and search for those topics: .NET 8, Web API, Entity Framework, Code-First Migrations & SQL Server
what is a reposiitory? a code repositiory? or somethnig dfiferent? also could youu show how to implement a service and a repository? can't fiind any info really onlinie, just argumments by people
A repository is a code pattern where your data access is abstracted to a class that attempts to mimic your data as an in memory list. It is popular in Domain Driven Design
ti amo grazie a te posso adottare coccioli yeahh
Make a of Angular 17 and . net 8
I'd love to see a MySQL server version of these types of video.
Not all of us, here in the UK can get decent .Net hosting with more than one MS SQL DB, while having pretty much unlimited MySQL DBs on the same hosting as he single MS SQL DB.
did you @PixelProfessor already get it working with Mysql because im stuck trying?
@@xanderperlee1448 Not yet I'm still beavering away.
I'm using the nuget packages (latest 8 versions, or pre-release);
Microsoft.EntityFrameworkCore
MySql.Connector
Pomelo.EntityFrameworkCore.MySql
I did get to a stage where the EF migrations set up the DB tables on MySQL.
I might go back to a new Blazor Web API project, and start following the tutorial again. Trying to implement the MySQL stuff.
I like i subscribe
How does the API know how to update the superhero (PUT) without using _context.SuperHeroes.Update(dbHero); ?
Great video. Can you Please do one video that deals with the existing database? That is we do not need to create it from VS2022.
14:15 anyone else hear this in Matt Berry's "new york citaayy" voice
I love you
i love u
good afternoon!
gift - documentary:
ua-cam.com/video/-sQmSBJgNj8/v-deo.html
good week!
Hi Your teaching way is too good
But I thought you would tell new thing in .net 8.0 but it just normal video 😟😟
🥰🥰🥰🥰🥰
i guess u are not going to reply
All the big tech companies are using Java.. Sir if we study dotnet then there will be future
Minimal API >>>> controllers in just about every way.
Why?
Why
you are, in fact, the goat🥹
Thank you so much you were so clear just try sometimes to do a example with a more real example not with heroes hahahaha