0
有沒有辦法將下面的2個linq表達式轉換爲1?將2個linq表達式轉換爲
var criticalCategories =
_commonDao.GetAllByExpression<CategoryItem>(
x => x.Category.Uid == gridAnswer.ActivityCategory.Uid && x.Critical);
if(criticalCategories.Any())
{
criticalWeight = criticalCategories.Min(x => x.Weight);
}
您是否正在將'criticalCategories.Any'和'criticalCategories.Min'結合起來? 'criticalCategories'爲空時'criticalWeight'的值應該是多少? – Aducci