What is Entity Framework?
In this lesson, I'll be introducing you to the Entity Framework
What is Entity Framework Core?#
In the last lesson, we created our first model. Now it's time to make a connection with the database. As discussed, we will be using Entity Framework Core for this. Let's see what exactly Entity Framework Core is.
It is the latest version of Entity Framework. its previous version was EF6. It is lightweight, open-source, extensible and cross-platform, so you can use it on any platform. The most important thing to know is that it's an Object Relational Mapper which I'm going to talk about in the next slide. For now, you can think of it as an alternative to ADO .NET, which again establishes a connection with the database. The best thing is that it lets you write database queries in a single language. Since you're using C# to write your queries, you use LINQ over SQl which makes the queries much more optimized. Also, you don't have to create the database, you just write models and it maps them to tables easily.
Now let's understand what exactly an ORM is. Well, it stands for Object Relational Mapper. What it does is that it establishes a connection session with the database. It lets you query & mutate the database using the Object oriented paradigm. You use the language you know to query the database, so it's fine if you don't know how to write SQL queries, since it's not a direct connection to the database. It abstracts from direct connection and switching the database becomes easy since you're now writing the database's language; you just change the database and it works the same way. You don’t have to manually write big SQL queries which saves time and since you write less code, chances of making an error are lesser. One great thing about it is that you write the model and it makes a database table out of it. Now let's see how it fits to our architecture.