生成动态 IQueryable来自英孚
我有一个充满订单的表,其中每个订单都有一个状态(例如:失败、拒绝、待处理、取消或成功
)
如何编写动态查询来按状态返回订单,其中我要经过一个或多个州?
即所有失败、拒绝或取消的订单:
IQueryable<MyType> query = from o in Model.Orders
where o.OrderStatus == ("Failed" || "Denied" || "Cancelled")
select o;
I have a table full of orders, where each order has a state (for example: failed, denied, pending, cancelled or success
)
How can I write a dynamic query to return orders, by state, where I'm passing one or more states?
ie something like all failed, denied or cancelled orders:
IQueryable<MyType> query = from o in Model.Orders
where o.OrderStatus == ("Failed" || "Denied" || "Cancelled")
select o;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用Contains方法
You can try to use the Contains method