I have the below LINQ that is returning zero IF there aren't any Addresses(Inner Join). How would I make this an Outer Join and then only Take(1)
?
var results = query.Join(
DB.tblAddresses.Where(t => t.AddressTypeID == 'm' || t.AddressTypeID == 'b').OrderByDescending(x => x.AddressTypeID),
p => p.PersonID,
a => a.PersonID,
(p, a) =>
new
{
p.PersonID,
p.LastName,
p.FirstName,
p.MiddleName,
p.SSN,
p.BirthDate,
p.DeathDate,
AddressLine1 = a.AddressLine1 ?? string.Empty
});
return results.CopyLinqToDataTable();