我想在LINQ to sql中将此请求转换为:
@H_403_2@SELECT * from Agir where NouvelIncident='1' AND facturable is null
我的尝试:
@H_403_2@public static List<Agir> GetINDEFAgir() { DataClassesActilogDataContext db = ContextSingleton.GetDataContext(); List<Agir> list; var v = from i in db.Agir where i.facturable is null && i.NouvelIncident == true select i; list = v.ToList(); return list; }LINQ to sql中似乎不允许“is null”…我有一个错误.
在此先感谢您的帮助
解决方法
使用==,’是’是检查类型
@H_403_2@public static List<Agir> GetINDEFAgir()
{
DataClassesActilogDataContext db = ContextSingleton.GetDataContext();
List<Agir> list;
var v = from i in db.Agir
where i.facturable == null && i.NouvelIncident == true
select i;
list = v.ToList();
return list;
}