我有一个错误:
错误2“INT []”不包含“包含”的定义和最佳的扩展方法过载“System.Linq.Enumerable.Contains(System.Collections.Generic.IEnumerable,TSource)”具有一些无效参数
这是我的代码:
public partial class mymymy : System.Web.UI.Page
{
int[] validType = { 2, 3, 4, 5, 6, 8, 13, 14, 16, 22 };
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
using (var dc = new soxMainDataContext())
{
var qry = from item in dc.LeaveRequests
where **validType**.Contains(item.Type)
&& item.MgtApproval == null
select item;
e.Result = qry;
}
}
}