I have a statement like this:
AssignedCas AssignedCase in caseList.GroupBy(o => o.CaseBatch.CaseBatchName)
.Select(g => g.First()).ToList()
But at time o.CaseBatch.CaseBatchName can be null, in which case the above statement will not execute.
Is there a way in the above statement to check if CaseBatchName is not null and only then include it.