错误“LINQ to Entities中不支持LINQ表达式节点类型'ArrayIndex'。” [英] Error "The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities."

查看:111
本文介绍了错误“LINQ to Entities中不支持LINQ表达式节点类型'ArrayIndex'。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Linq获取一些数据到sql

但是在LINQ to Entities中不支持错误LINQ表达式节点类型'ArrayIndex'。在下面的代码中。 />

I am trying to get some data using Linq to sql
But getting the error "The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities."in code below.

Tab[] items = db.Tabs.Where(c => c.PortalID == 32 && c.ParentID == 1983).ToArray<tab>();



但是当我改变下面的where条件时,代码正常工作。


But when I changed the where condition like below , the code is working.

Tab[] items = db.Tabs.Where(c => c.PortalID == 32 ).ToArray<tab>();



第一个条件在数据库中没有数据,但第二个条件的数据是存在的。

如何检查是否存在从db返回的一些数据?


There is no data in db for the first condition, but data is there for the second condition.
How can i check whether there is some data returning from db?

推荐答案

根据这段代码,没有人可以帮到你。所以,我强烈建议阅读这些文章:

LINQ to Entities [ ^ ]

LINQ to Entities中的已知问题和注意事项 [ ^ ]

支持和不支持的LINQ方法(LINQ to Entities) [ ^ ]
Based on this piece of code no one can help you. So, i'd strongly recommend to read these articles:
LINQ to Entities[^]
Known Issues and Considerations in LINQ to Entities[^]
Supported and Unsupported LINQ Methods (LINQ to Entities)[^]


这篇关于错误“LINQ to Entities中不支持LINQ表达式节点类型'ArrayIndex'。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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