给出一个如下文档:
public class Post {
public string Title { get; set; }
public List<string> Tags {get; set;}
}
如何为RavenDB linq提供程序创建此linq查询。
from post in Posts
where post.Tags.Contains(someTag)
select post
答案 0 :(得分:2)
from post in Session.Query<Post>()
where post.Tags.Any(tag => tag == someTag)
select post
答案 1 :(得分:1)
杰克逊 像这样:
from p in session.Query<Post>()
where p.Tags.Any(tag => tag == someTag)
select p;