I have a many to many relationship in my EF4 model (many groups can have many programs).
I have a set of program Id’s and a group. I want my group to have the programs that are represented by the program Id’s that I have.
What I don’t want to do is go to the database to get the program entities. I already know their Id’s.
How do I do this?
Use a trick with dummy classes:
The only requirement is that none
Programfrom programIds is already loaded. If any program is loaded it will be more complicated because you will first have to check it inObjectStateManagerand use loaded instance.