Entity Framwork
Entity Framwork
Entity Framework (EF) is an Object-Relational Mapper (ORM) for .NET developed by Microsoft. It allows developers to interact with a database
using .NET objects, instead of writing raw SQL queries. EF simplifies data access by abstracting the database layer and mapping database tables to C#
classes.
Main Features of Entity Framework
• Object-Relational Mapping (ORM): Maps database tables to .NET classes.
• LINQ Support: Query the database using LINQ syntax.
• Change Tracking: Automatically tracks changes made to objects.
• Migrations: Manage database schema changes via code.
• Lazy/Eager Loading: Load related data on demand or immediately.
EF Approaches
Approach Description
Code First Define your C# classes, then EF generates the DB.
Database First Generate C# models from an existing database.
Step 1:
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7