Hey Everyone,
I've noticed that sometimes when I write a projection query using linq and an iQueryable, if I select a field from a related entity, the query treats that relation as if it was an inner join.
For example, the following query eliminates any records where there does not exist a relationship between the contact and credential tables, as opposed to simply returning null or false.
var projection = contactQueryable.Select(contact => new
{
ColleagueId = contact.ColleagueId,
Email = contact.Email,
FirstName = contact.FirstName,
LastName = contact.LastName,
IsActive = contact.IsActive,
HasAccount = contact.Credential.IsApproved // the line in question
}).ToList();
If I remove the last line in the projection I get all of my records.
Any thoughts as to what I'm doing wrong, or how I could tell llblgen pro to not eliminate those records if the colleague isn't associated with a credential?
Thanks!