我有 :
public void InitializeStatusList(DropDownList list) { var dictionaryEntries = GetEntriesFromDatabase(); list.DataSource = dictionaryEntries.Where(entry => entry is EntryStatus1 || entry is EntryStatus2); list.DataBind(); }
我有很多这样的功能.我想用translateEntries作为谓词传递的查询条件编写公共函数.
例如:
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(); }
什么代表???????????????
提前致谢
解决方法
Func< Entry,bool>谓词应该有效,其中Entry是入口变量的类型.