6
Shouts

Entity Framework: Queries involving many to many relationship tables « Mehroz’s Experiments

published 1057 days, 25 minutes ago posted by mehrozmehroz 1057 days, 21 hours, 56 minutes ago
Wednesday, June 30, 2010 12:37:34 PM GMT Tuesday, June 29, 2010 3:06:42 PM GMT

Entity framework handles tables participating in Many to Many relationship in a nice manner. If the junction table (sometimes called bridge table, association table, link table, etc) only consists of the foreign keys and no other columns, then that table is abstracted by EF and the two sides get a navigational property exposing a collection of the other side. If the junction table contains other fields as well (e.g. the table has its own primary key column), then that junction table is included in the model with many-to-one relationships with both the participating tables. This post will present some common LINQ queries involving the many to many relationship tables in both scenarios: when the junction table is abstracted by EF, and when it is exposed ...

category: Architecture | clicked: 2 | | source: smehrozalam.wordpress.com | show counter code
tags: Query, Linq To SQL, Entity Framework, Linq