/// <summary>
/// Find all of the Areas that are Parents without children Areas.
/// </summary>
/// <returns>IQueryable object full of Areas.</returns>
public IQueryable FindParentAreas()
{
return db.Areas.SelectMany(x => x.ParentAreaID == null);
}
I want to return a collection of Area objects that are parent Areas, meaning they have null values in the ParentAreaID field (in my database).
It seems I can't just compare it to null because null in C# maybe means something else in Microsoft SQL Server.
Any guidance? Should I even be using SelectMany?