I have this var activityGroup = context.Activity.Where(c => c.ActivityId == activityId).Select(c => c.ActivityGroupId);
If there is no ActivityGroupId "for seome reason " (still don't know why) that query will return a list where the first item is null... how do i check if this list is not null or if it has Any elements?
FYI
- I know the existence of
.Any()but since the first item is null doing.Any()will returntrue.
- Is it okay if i do this:
if (activityGroup.Contains(null)) { // do something here }