I am having trouble getting my LINQ request as I would like. I am not sure that I am using the correct approach.
Tables:
I have two tables Contacts
and Permissions
with which I execute LEFT OUTER JOIN .

Join request:
from contact in Contacts
join permission in Permissions on contact.Id equals permission.ObjectId into permissionGrp
from p in permissionGrp.DefaultIfEmpty()
where (p==null && isAllowed) || (p!=null && ))
orderby
select new { contact, permission = p };
This corresponds to the permissions for the contact, where applicable, and null
if there is no corresponding permission.

Desired
I do not want to duplicate contacts, I'm only interested in the first Contact-Permission entry. For example:

Attempt:
So, I suggested that I need Group By
my contact.Id
and somehow select FirstOrDefault()
in the permission collection.

from contact in Contacts
join permission in Permissions on contact.Id equals permission.ObjectId into permissionGrp
from p in permissionGrp.DefaultIfEmpty()
where (p==null && isAllowed) || (p!=null && ))
orderby
group p by contact into contactPermissionsGrp
select new { contact = contactPermissionsGrp.Key, permission = contactPermissions.FirstOrDefault() };
Result:
, NotSupportedException: Specific method is not supported.
. , LightSpeed ORM.
.