S
shapper
Hello,
I have 3 tables with a many to many relationship:
Professors > ProfessorID, Age, ...
Tags > TagID, Name, ...
ProfessorsTags > ProfessorID, TagID
How can I get all the professors and all tags associated to each
professor using LINQ?
I have the following:
List<ProfessorPaper> papers = (from p in database.Professors
orderby p.Name
select new ProfessorPaper {
Professor = p,
Tags = new List<Tag> {
}
}
}).ToList();
ProfessorPaper is a wrapper that contains two properties: Professor
and List<Tag>.
In my query what I am missing is filling the tags for each professor.
Could someone, please, tell me how to do this?
Thanks,
Miguel
I have 3 tables with a many to many relationship:
Professors > ProfessorID, Age, ...
Tags > TagID, Name, ...
ProfessorsTags > ProfessorID, TagID
How can I get all the professors and all tags associated to each
professor using LINQ?
I have the following:
List<ProfessorPaper> papers = (from p in database.Professors
orderby p.Name
select new ProfessorPaper {
Professor = p,
Tags = new List<Tag> {
}
}
}).ToList();
ProfessorPaper is a wrapper that contains two properties: Professor
and List<Tag>.
In my query what I am missing is filling the tags for each professor.
Could someone, please, tell me how to do this?
Thanks,
Miguel