I have an entity like the following:
class Person
{
public ICollection<string> OptOut { get; set; }
//other fields
}
My application allows the user to create dynamic mailing lists based on a well-known set of fields in Person
.
The customers should be able to opt out of the different mailing lists, so OptOut
might contain something like [ "Marketing", "Financial" ]
.
The query for a specific mailing list currently aggregates the filter expressions (using Queryable.Where
) and RavenDB creates the needed indexes without problems.
I have been reading, and it seems neither of these constructs are supported:
people.Where(x => !x.OptOut.Contains(mailingListType));
people.Where(x => !x.OptOut.Any(o => o == mailingListType));
people.Where(x => x.OptOut.All(o => o != mailingListType));
How can I create the right query?