from pt in context.PART_TYPE
join pa in
(
(from PART_AVAILABILITY in context.PART_AVAILABILITY
where
PART_AVAILABILITY.DATE_REF == dt
select new
{
PART_AVAILABILITY
}
)
)
on new { PART_TYPE_ID = pt.PART_TYPE_ID } equals new { PART_TYPE_ID = pa.PART_AVAILABILITY.PART_TYPE_ID } into pa_join
from pa in pa_join.DefaultIfEmpty()
where
pt.VEHICLE == 409
select new
{
PART_TYPE = pt,
PART_AVAILABILITY = pa.PART_AVAILABILITY
};
dt
is DateTime
object.