实体框架的收集值参数? [英] Collection-valued parameters with The Entity Framework?

查看:96
本文介绍了实体框架的收集值参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的最后一个项目中,我决定使用实体框架,一直进行得很好,直到我尝试使用获取数据,中,我收到错误。

In my last project i decided to use Entity Framework and it was all going well until i try to get datas with "where in", i got an error.

经过微小的搜索,我想出了一个那个帖子

After a tiny search i ve come up with this post and that post.

这是我想要做的

var all = fooelements
              .Where(l=>controlsToGet
                            .Contains(l.Control.Name));

有没有可以使用lambda表达式或LINQ与Entity Framework进行对比?

Is there any to handle it with lambda expressions or linq with the Entity Framework ?

谢谢

推荐答案

根据以前的答案,我有一个提示,使其变得容易这样做:

Building upon the previous answer I have a tip that makes it easy to do this here:

提示8 - 如何使用LINQ to Entities编写WHERE IN样式查询

希望这有帮助

Alex James

Alex James

项目经理 - 实体框架团队

Program Manager - Entity Framework Team

实体框架提示

这篇关于实体框架的收集值参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆