/ Published in: C#
NOTE: When you do an outer join, every column selected that could be null from the join must have a ternary operator in the select statement.
- var allTeamMembers = from t in db.TeamMembers
- join ct in db.CaseTeamMembers on t.TeamMemberID equals ct.TeamMemberID into ctm
- from ct in ctm.DefaultIfEmpty()
- select new
- CaseID = ct.CaseID == null ? 0 : ct.CaseID,
- CaseTeamMemberID = ct.CaseTeamMemberID == null ? 0 : ct.CaseTeamMemberID,
- Photo = t.Photo ?? "default.gif"
You need to login to post a comment.