开发者

Does Entity Framework 4 support Many-to-Many queries?

开发者 https://www.devze.com 2023-01-11 07:01 出处:网络
I have the exact same problem as described in this post (event content / tags objects): LINQ to entities - Building where clauses to test collections within a many to many relationship

I have the exact same problem as described in this post (event content / tags objects):

LINQ to entities - Building where clauses to test collections within a many to many relationship

I am getting the Exception:

Unable to create a constant value of type 'XXX.Tag'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.

Is开发者_StackOverflow this problem resolved in E.F. 4?


this should work fine in EF4.0

from tag in db.Tags where tag.Name.Contains("mytag") from content in tag.Contents select content

0

精彩评论

暂无评论...
验证码 换一张
取 消