Here's a Person object :
public class Person
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string[] NickNames{get;set;}
}
Suppose that we want to query all the persons with a certain nickname.("Tough Guy" for example)
I thought I could write it like this :
var query=session.Query<Person>().Where(p=>p.NickNames.Contains("Tough Guy"));
but this statement generates an empty query.
I know I could use Any() but the problem is that I want to translate a string into a Linq query (For example : FirstName.Equals("John") AND NickNames.Contains("Tough Guy")) using Dynamic Linq Library and this library doesn't support extension methods such as Any ( unless I modify its source which I think it would be the last option)
So the question is how I can search for Though Guys in a list of documents ? :)