Introduction to entity framework core
ฝัง
- เผยแพร่เมื่อ 9 ก.พ. 2025
- This is an introduction to Entity Framework Core. Entity Framework Core, also called EF Core is a complete rewrite from the ground up. If you have any experience with previous versions of Entity Framework, you will find lot of familiar features.
Text version of the video
csharp-video-t...
Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
/ @aarvikitchen5572
Slides
csharp-video-t...
ASP.NET Core Text Articles & Slides
csharp-video-t...
ASP.NET Core Tutorial
• ASP.NET core tutorial ...
Angular, JavaScript, jQuery, Dot Net & SQL Playlists
www.youtube.co...
What is EF Core
EF Core is an ORM (Object-Relational Mapper).
EF core is lightweight, extensible, and open source software. Like .NET Core, EF Core is also cross platform. It works on windows, Mac OS, and Linux. EF core is Microsoft’s official data access platform.
What is ORM
ORM stands for Object-Relational Mapper and it enables developers to work with a database using business objects. As a developer we work with the application business objects and the ORM generates the SQL that the underlying database understands. In-short, an ORM, eliminates the need for most of the data-access code that developers usually need to write.
Why use an ORM
Let's understand, the use of an ORM with an example. If we are developing an application to manage employees we would have classes like Employee, Department etc in our application code. These classes are called the Domain classes.
Without an ORM like EF Core, we have to write a lot of custom data access code to store and retrieve employee and department data from the underlying database.
For example to read, insert, update or delete data from the underlying database table we have to write code in the application to generate the required sql statements that the underlying database understands. Also when the data is read from the database into our application, we again have to write custom code to map the database data to our model classes like Employee, Department etc. This is a very common task that we do almost in every application.
An ORM like EF Core can do all of this for us and saves a lot of time. It sits between our application code and the Database. It eliminates the need for most of the custom data-access code that we usually have to write without an ORM.
EF Core Code First Approach
EF Core supports both Code First approach and Database First approach. However, with the Database First approach there is very limited support in EF core at the moment.
With the Code First Approach, we first create our application domain classes like Employee, Customer etc and a special class that derives from Entity Framework DbContext class. Based on these domain and DBContext classes, EF Core creates the database and relevant tables. Out of the box, EF Core uses it's default conventions to create the database and database tables. You can change these default conventions if you want to.
EF Core Database First Approach
Sometimes we may have an existing database. When we have a database and the database tables already, we use the database first approach. With the database first approach, EF Core creates the DBContext and Domain classes based on the existing database schema.
EF Core Database Providers
EF Core supports many relational and even non relational databases. EF Core is able to do this by using plug-in libraries called the database providers. These database providers are available as NuGet packages.
List of EF Core Database Providers
docs.microsoft...
A database provider, usually sits between EF Core and the database it supports. The database provider contains the functionality specific to the database it supports. Functionality that is common to all the databases is in the EF Core component. Functionality that is specific to a database, for example, Microsoft SQL Server specific functionality is with-in the SQL Server provider for EF Core.
We will discuss more about this provider model when we include support for SQL server in our asp.net core application in our upcoming videos.
This is the first video I found which explains the concept first so I can understand the code. Thanks :D
Thank you for including EFC in this series!
Best Tutor in the world
After quite a long time wait, Sir venkat is here. Hats off sir.
Good information Sir.
Venkat! Venkat! Venkat! Thank you Sir ✨
Thank you for this helpful content. Always Excellent.
Lead us to the land of: Entity Framework Core, Asp.Net Core, SSMS, and Angular!
Hi Sir,
It would be really helpful if you can upload videos for LINQ to Entities.
Amazing videos from you. Have been following all your tutorials. They are crystal clear. Thanks alot for these!!!
Very good explanation! Thanks for your time spent doing this.
Thank you sir.. your videos all are awesome..
Welcome back, Hope all is well and good. Excellent content, looking forward for the next video. Keep up the great work.
I don't agree that Database first have *very* limited support since it will do the job.. Its actually a more robust way of developing if you ask me. A database should never depend on the code of one project. The code should depend on the database-design as project scales you are likely to have more units connecting to the db then your mvc-project. Code-first encourages lazy database design.
However for smaller apps code-first makes progress very fast since it provides the feeling that you are relieved of having to do db-stuff.
As you get comofortable with EF you will most likely use a mix of database-first and code-first.
EF core have limitation today that forces you to use work-arounds. But its not strictly limited to Database-first approach.
Agree! For professional enterprise application, people start with architecturing and designing the database before diving into code.
Fully agree. I'm a senior dev watching this series to get up speed on asp core... and while the series is pretty good, I worry for new/junior devs that watch the videos without the deeper understanding of the underlying functionality. The video presenter shows the asp functionality and helper functions, but doesn't explain that these are abstractions and may not be appropriate for larger applications. I'd personally not even use EFC except for simpler queries, and instead opt to program my own data access layer. Database optimization is something often overlooked, and not having direct access to your queries is a big detriment in my opinion. I'd consider EFC for small self contained projects, but even then, I'd use the database first approach.
5th to view. V helpful.
Please do vlog tell us about yourself and answer few personal questions
Really great explanation thanks
Thank you very much
and best regards
Thank you!
do we have mode first approach in entity framework.Can you please guide me on the same.I did not find ADO.net entity model to create a model first
Thanks for starting series on EF core
Dear kudvenkat. Would you please do the tutorial on Contoso University by Microsoft for Asp.Net core Mvc. I found some other videos but none of them are understandable.
I just want to know if the accepted norm is to take the code first approach or is it a "depends on your situation"?
Thank You Sir :)
Thanks Venkat.
Hey, could you please tell if BCA IS WORTH DOING
i am a bit confused, is this EF core or EF core 2.0?
nice
Thank you Sir.
Sir please make a video tutorial on Entity Framework Core
Thank you
make vedio on DateTimeOffset
thanks
Please share dot net core api with layered architecture
Merry eastmas :)
Entity framework sumthing that I had always struggled to understand
Second
the video image is too poor, you need to fix it more
EFC sucks, If two programmers showed up at my work, one knowing EFC and another SQL, I would always go with the SQL programmer