convert IQueryable to

前端 未结 6 799
滥情空心
滥情空心 2020-12-16 18:01

I want to select my price level in database to compare with the an integer number. But It is error : Operator \'==\' cannot be applied to operands of type \'System.Linq.IQue

6条回答
  •  佛祖请我去吃肉
    2020-12-16 19:00

    replace:

    if (list_pricelevel == 3) 
    

    with:

    if (list_pricelevel.First() == 3) 
    

    as you can see here: http://msdn.microsoft.com/en-us/library/bb291976.aspx, if you are sure there is a result or use FirstOrDefault...

提交回复
热议问题