tags:

views:

61

answers:

1

I have 3 tables, Customer, Surfboards, and CustomerSurfboards. CustomerSurfboards is the Joiner table.

Customer      CustomerSurfBoards    Surfboards   
----------    -------------------   ------------  
CustomerID    CustomerSurfboardID   SurfBoardID
IsActive      CustomerID
              SurfboardID

I want to select all surfboards where the customer IsActive = true

And I need to do this in Linq using C#

+2  A: 
var query = from sb in db.Surfboards
            join csb in db.CustomerSurfBoards on sb.SurfBoardID equals csb.SurfBoardID
            join c in db.Customers on csb.CustomerID equals c.CustomerID
            where c.IsActive
            select sb;
Jason
LOL, for some reason when I wrote that in VS intellisense was telling me it was wrong - thanks
Slee