I have a document like this:
{
"Document":{
"Principles":[{"text":"Text","history":["Text1","Text2","Text3"]}]
}
}
I would like to search for all Principles that contain a history that contains "Text".
I have 2 interfaces like this :
[Entity]
public interface IDocument
{
string Id{get;}
ICollection<IPrinciple> Principles{get;set;}
}
[Entity]
public interface IPrinciple
{
string Id{get;}
ICollection<string> history{get;set;}
string text{get;set;}
}
Here's what I did :
using(var context=new MyEntityContext(connectionString))
{
var principles=(from p in context.Principles where p.history.Any(h=>h.Contains("Text")) select p).ToList();
}
But I am getting a list that contains no principle.