I have two table, WOMain and WOPlanner, related to each other with ID. What I want, is to run a query and add to ViewModel data from both tables, even if is there is no related data in WOPlanner. Right now, I can only see data that has records in both tables.
- WOVL = await (from a in _context.WOMains.Where(s => s.OrgID == orgid)
- join b in _context.WOPlanners on a.WOMainID equals b.WOMainID into Temp1
- from c in Temp1
- select new WOViewIndex
- {
- WOMainID = a.WOMainID,
- WONumber = a.WONumber,
- WONumberS = c.WONumberS,
- CreateDate = a.CreateDate,
- Deficiency = a.Deficiency,
- WOStatus = a.WOStatus
- }).ToListAsync();