我有 :
public void InitializeStatusList(DropDownList list)
{
var dictionaryEntries = GetEntriesFromDatabase();
list.DataSource = dictionaryEntries.Where(entry => entry is EntryStatus1 || entry is EntryStatus2);
list.DataBind();
}
我有很多这样的功能。我想编写dictionaryEntries
查询条件作为谓词传递的通用函数。
例如:
public void InitializeStatusList(DropDownList list)
{
CommonInitializeStatusList(DropDownList list, entry => entry is EntryStatus1 || entry is EntryStatus2);
}
public void CommonInitializeStatusList(DropDownList list, ??????????????? predicate)
{
var dictionaryEntries = GetEntriesFromDatabase();
list.DataSource = dictionaryEntries.Where(predicate);
list.DataBind();
}
代表什么???????????????
提前致谢