views:

1761

answers:

2

Hello,

In my project I have 'Player'(PlayerID and data) table, 'Games' table (GameID, Name) and I made a many to many table 'PlayerGames' (PlayerID, GameID - I created the forign keys relations)

PlayerID and GameID are primary keys in their tables and the tuple (PlayerID,GameID) are primary key in 'PlayerGames' Table

I tried to map these tables in classes using the designer in visual studio.

But in the player class I don't have 'Games' property with a list of games. Instead, I'm having PlayerGames property of type EntitySet.

How can I do it?

+2  A: 

check this post out

Konstantinos
And what about adding/removing games? I want it to be automatically.What I've done so far is creating Games Property in the Player class that obtains all the games using linq.But What if I want to add games to this player(note, not create new games, just a record in PlayerGames.
Yarin Miran
+1  A: 

You might also want to check out CodeSmith's PLINQO. It's not free, but it's a super-pimped version of Linq to Sql and it supports many-to-many relationships, among other things.

Chris