Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to determine whether to use join in linq to sql?
- Table 1 Customer
- id
- name
- Table 2 addresstype
- id
- address1
- customerid
- var address = from cu in Customer
- from ad in addresstype
- where cu.id == ad.customerid
- select ad;
- var address = from cu in Customer
- join ad in addresstype on cu.id equals ad.customerid
- select de;
- select ad.*
- from Customer cu, AddressType ad
- where cu.ID == ad.CustomerID -- I assume this was meant by the OP
- select ad.*
- from Customer cu
- inner join AddressType ad on cu.id = ad.CustomerID;
- new {X,Y} equals new {X',Y'}
- var query = from cu in Customer
- from ad in cu.Addresses
- select ad;
Add Comment
Please, Sign In to add comment