I am using a linq query to get my data from table and I am applying a left join but I couldn't find a way to handle empty dates. Example below
- CraftWorkViews = await (from a in _context.WOMains.Where(s => s.OrgID == orgid)
- join b in _context.WOPlanners.Where(s => s.Craft == craftid) on a.WOMainID equals b.WOMainID into Temp1
- from c in Temp1
- join d in _context.WOPlannerSCHs on c.WOMainID equals d.WOMainID into Temp2
- from e in Temp2
- select new CraftWorkView
- {
- WONumber = c == null ? 0 : c.WONumber,
- Subsequent = c == null ? 0 : c.WONumberS,
- Activity = c == null ? " " : c.Activity,
- StartDate = e == null ? ???? : e.StartDateP,
- EndDate = e == null ? ???? : e.DueDateP,
- CompletionDate = e == null ? ???? : e.CompDateP
-
- }).ToListAsync();