Friday, November 1, 2013

Linq to Entities - join many-to-many 關聯的寫法

http://peter.hahndorf.eu/blog/post/2010/12/31/UsingLinqInManytomanySelectScenarios

不是那麼直覺哦,要寫的是兩個 from

from c in context.Clubs
from p in c.Persons
where p.PersonId == 3
select new { Name = c.Name };

No comments:

Post a Comment