How to use Entity Framework Core in ASP.NET Core 6.0 MVC | Database First Approach

preview_player
Показать описание
#entityframeworkcore #dotnetcore #mvc #entityframework #nihiratechiees

This video explains how to use Entity Framework Core 6.0 in ASP.NET CORE 6.0 MVC

Topics covered
=============
1, Add Entity framework to ASP.NET Core MVC using database first approach
2, CRUD operations in ASP.NET Core MVC application

Steps need to follow
=================
1, Create .NET Core application using MVC template.

2, Install the below nugget packages
1, Microsoft.EntityFrameworkCore
2, Microsoft.EntityFrameworkCore.Sqlserver
3, Microsoft.EntityFrameworkCore.Tools

3, Generate DbContext using scaffold command
Scaffold-DbContext "connectionstring" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

4, Update DbContext object
Scaffold-DbContext "Connectionstring" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -t tablename -f

5, Check the database connectivity
6, Complete CRUD operation using scaffold modal generation
Рекомендации по теме
Комментарии
Автор

dude I spent 3 hours trying to figure it out on my own and you did it in 20 minutes. Thank you so much

windcrown
Автор

Wow, perfect video. To the point and everything worked as shown (even though I used VS 2022)! Thanks very much!

kulfurj
Автор

Wow you are cool i spend 1day to
Learn this and get confused you have done it in 20 mins with more clarity keep rocking man❤

joshijoshi
Автор

Thank you very much🙂!
I wrote half of the project thanks to this video. Just need to add authorization and styles.
Good luck 😉

liudmylaseveryna
Автор

I was not able to handle dataabase first in my application, but now I can. Thanks

zeeshanazeem
Автор

done it using the 5.0.17 runtime in 2019 haha had to use a bit of different configuration in importing the ssms model scaffolding. very helpful video

marnlowe
Автор

So any tutorial showing how to manage .net core frameworks and it's components is showing to how to do that through visual studio. I mean, is there any video how to achieve this through cli commands on linux?

gorantolusic
Автор

Hey man, great tutorial, one question, for me to use the context in other controllers, I will always have to declare the variables as you did in the video? There is no way to make it globally? If yes, how to do it?

JoosephLr
Автор

why i update dbcontext (scaffold dbcontext ... -t tbl_customer) it remove all table in my models and only one table appeared is tbl_customer update, what happens to the remaining tables and how to get them, please help me sir

phuccute
Автор

How can I execute store procedure and joining multiple tables here... please help sir...

biswarupmukherjee
Автор

Is this works for many to many relationship also

arunakararpula
Автор

Thank you for your kind lecture. I learned a lot

esbdigy