建议:查询组合不够简单,建议参考这种表达式的方法!! 返回
C#论坛
老数据
6
2110
悬赏:5 飞吻
我看了下文档,比如 in not in 都是单独调用,组合查询书写麻烦,我现在是这样的,感觉便捷多了!!
var centerList = EntityDBExpand.GetList<Bas_FN_CenterConfigObject>(o => o.UpStationID == null && o.StartStationID != BelongCenterID && o.ProductID == item.ProductID && o.FinalPlaceCityID.In(cityArray) && o.IfDel == 0);
这个现在常用的支持 like、 in 、notin、 != 、null、 <> 、==、 likeStart likeAll likeEnd 等
楼主改进成这样 就更好了
热忱回答(6)
-
fate stay night VIP0
2019/4/11支撑的你认真看in支持表达式 你说的都可以
0 回复 -
fate stay night VIP0
2019/4/11文档认真看
0 回复 -
fate stay night VIP0
2019/4/11Ids.contains (it.id)就是Id in ids
0 回复 -
大脸猫? VIP0
2019/4/12@fate stay night:
我看了下确实有contains ,感觉不够简洁,对了 还一个问题
条件查询怎么使用,没在文档中看到
比如:
if(userid>0)
{
然后 进行拼接sql
}
if(typeid>0)
{
然后才加这个条件
}
0 回复 -
fate stay night VIP0
2019/4/12whereif
0 回复 -
大脸猫? VIP0
2019/4/12哦,看到了
0 回复