日期:2014-05-20  浏览次数:20828 次

求了句linq写法,关于条件查询的,isnull
var q = db.company_job.Count(u => u.sate == true && u.selectjob == Convert.ToInt32(rselectjob3.SelectedValue));

如何改成下面这句?
from company_job where selectjob=isnull(@selectjob,selectjob) and sate =1

谢谢

------解决方案--------------------
var q = db.company_job.Count(u => u.sate == true 
&& u.selectjob == (Convert.ToInt32(rselectjob3.SelectedValue) == xxx ? u.selectjob : Convert.ToInt32(rselectjob3.SelectedValue)));


????