Welcome Guest - Login
PLINQO
home Home
feature-tour Feature Tour
getting-started Getting Started
download Download
documentation Documentation
Forums Forums



Quick Search
»

PoweredBy
Get CodeSmith Free! We want to get the word out about PLINQO and are willing to give CodeSmith away in order to do so. Check out the details!

Many to Many Relationships



Almost every project requires the use of many to many relationships and LINQ to SQL does not support it. As you probably guessed, PLINQO does! Let's go through a quick sample of a many to many scencario in PLINQO. Below is a diagram of a many to many relationship between the User and Role entities.

Image

The UserRole table before any many to many code is executed.
Image
The code here adds a User to a Role.

using (var context = new TrackerDataContext())
{
    User u = context.User.GetByKey(1);
    Role r = context.Role.GetByKey(1);
    u.RoleList.Add(r);
    context.SubmitChanges();
}

The result in the database after the code is executed.
Image

Read more about how PLINQO implemented many to many relationships.

Powered by ScrewTurn Wiki version 3.0.1.400.