Linq与IDataServiceQueryable [英] Linq with IDataServiceQueryable

查看:88
本文介绍了Linq与IDataServiceQueryable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个LightSwitch测试应用程序。我连接到现有数据库。

I am writing a LightSwitch test application. I connect to an existing database.

我有一个非常简单的问题需要解决。我有一个ColorSet类,它与由中间表ColorSetColors实现的ColorClass有多对多的关系。我想创建一个查询来返回不在特定ColorSet中的所有颜色。

I have a very simple problem to solve. I have a ColorSet class with a many-to-many relation to a ColorClass implemented by an intermediate table ColorSetColors. I want to create a query to return all Colors not in a specific ColorSet.

我的问题更多的是Linq问题,但是作为IDataserviceQueryable< T>涉及和LightSwitch我相信这是发布这个的地方。

My problem is more of a Linq problem but as IDataserviceQueryable<T> is involved and LightSwitch I believe this is the place to post this one.

代码如下所示:


partial void ColorsNotInColorSet_PreprocessQuery(int?ColorSetID,ref IQueryable< Color> query )
partial void ColorsNotInColorSet_PreprocessQuery(int? ColorSetID, ref IQueryable<Color> query)

推荐答案

您需要显式转换为IQueryable,就像错误消息所示。你有没有尝试过并收到其他一些错误?

You need to explicitly cast to IQueryable, just like the error message says. Have you tried that already and received some other error?

(编辑:没说错。对不起。)

( That wasn't worded correctly. Sorry about that.)


这篇关于Linq与IDataServiceQueryable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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