I have two entities, Gallery and File. There are many galleries and each gallery can contain Files. A file can be present in multiple galleries. In the database there is an intermediate table, Gallery_Files which just contains two foreign keys, to link the tables.
I need to select the files in a particular gallery. My Linq statement is iis currently :
Return (From c In Context.Files _
Where c.Gallery.Id = GalleryId _
Where GalleryId is the primary key of the Gallery table/entity.
This is incorrect as there is no Gallery related object, only a Galleries set.
Could someone provide a suitable linq statement?