I\'m writing a LINQ to SQL statement, and I\'m after the standard syntax for a normal inner join with an ON
clause in C#.
How do you represent the follo
You create a foreign key, and LINQ-to-SQL creates navigation properties for you. Each Dealer
will then have a collection of DealerContacts
which you can select, filter, and manipulate.
from contact in dealer.DealerContacts select contact
or
context.Dealers.Select(d => d.DealerContacts)
If you're not using navigation properties, you're missing out one of the main benefits on LINQ-to-SQL - the part that maps the object graph.