Entity Framework Tutorial
Lesson 36 of 69 · Part 10 Entity splitting in entity framework · Database
Part 10 Entity splitting in entity framework
Text version of the video
http://csharp-video-tutorials.blogspot.com/2014/05/part-10-entity-splitting-in-entity.html
Slides
http://csharp-video-tutorials.blogspot.com/2014/05/part-10-entity-splitting-in-entity_20.html
Entity Framework – All Text Articles
http://csharp-video-tutorials.blogspot.com/2014/05/entity-framework-tutorial.html
Entity Framework – All Slides
http://csharp-video-tutorials.blogspot.com/2014/05/entity-framework-tutorial-slides.html
Entity Framework Playlist
Dot Net, SQL, Angular, JavaScript, jQuery and Bootstrap complete courses
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
Entity splitting refers to mapping an entity to two or more tables when the tables share a common key. Let us understand Entity splitting with an example.
If we have 2 tables – Employees & EmployeeContactDetails. ADO.NET Entity Framework by default generates 2 entities from the database using database first approach i.e Empoyee and EmployeeContactDetail entities.
There is a one to one mapping between tables and entities. We want a single Employee entity to map to both Employees & EmployeeContactDetails table.
To achieve this
1. Cut Email, Mobile and LandLine properties from EmployeeContactDetail entity and paste them in Employee entity
2. Delete EmployeeContactDetail entity. On “Delete Unmapped Tables and Views” window click NO.
3. Right click on Employee entity and select “Table Mapping” option from the context menu. Map EmployeeId, Email, Mobile and LandLine properties to the respective columns of EmployeeContactDetails table.