I want to return the category Name or just null within the projection below, but I get a null reference exception, which makes sense if result.CategoryId is null.
return results.Select(i =>
new Model
{
Score = i.Score
,Date = i.InstanceResult.TestDate
,Category = categories.Where(c=>c.Id.Equals(i.result.CategoryId)).SingleOrDefault().Name
});
c.Id.Equals(...)usec.Id == ...