You are performing an
INNER JOIN
- you will only get back results from the
Addresses
table which have a corresponding record in the
ExtraData
table.
If you want all records from the
Addresses
table, even if they have no corresponding record in the
ExtraTable
, then you need to perform a
LEFT JOIN
.
Perform left outer joins (LINQ in C#) - C# | Microsoft Learn[
^]
from a in context.Adresses
join ed in context.ExtraData on a.LFD equals e.lfd into edg
from e in ed.DefaultIfEmpty()
where a.PROJID == 2048
select new
{
RESPID = e.str03,
LFD = e.lfd,
PROJID = a.PROJID
}