I've got the basics of LINQ-to-SQL down, but I've been struggling trying to get JOINs to work properly. I'd like to know how to convert the following to LINQ-to-SQL (ideally using method chaining, as that is my preferred format).
SELECT c.CompanyId, c.CompanyName,
p.FirstName + ' ' + p.LastName as AccountCoordinator,
p2.FirstName + ' ' + p2.LastName as AccountManager
FROM dbo.Companies c
INNER JOIN dbo.Persons p
ON c.AccountCoordinatorPersonId = p.PersonId
INNER JOIN dbo.Persons p2
ON c.AccountManagerPersonId = p2.PersonId
Using query syntax:
Using method chaining: