/// <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);
}
我想返回父區域的Area對象集合,這意味着它們在ParentAreaID字段(在我的數據庫中)中有空值。無法從使用情況推斷方法的類型參數。嘗試指定類型參數ex - 錯誤。任何指導?
看來我不能將它與null進行比較,因爲C#中的null可能意味着Microsoft SQL Server中的其他東西。
任何指導?我是否應該使用SelectMany?
謝謝!但是,我仍然收到錯誤 - 「類型參數不能被傳遞」。看來我需要更加明確'空',但我不知道如何。 – 2010-06-18 16:12:10
Nevermind - 我按Ctrl + Shift + B重建,現在它沒有任何錯誤。謝謝! – 2010-06-18 16:23:56