I have a object list. That object contains a string List. Like that:
public class ObjectA
{
...
IList<string> StringList;
}
And I have a list of words to search on StringList. I need to search on a ObjectA list, and find all ObjectA that have all words (parts of all words).
So I did that:
List<ObjectA> myObjectList;
List<string> wordsToFind;
var result = myObjectList.Where(objectA => wordsToFind.All(objectA.StringList.Contains));
The problem is my result is getting only whole words (equals). I would like to get results that contains parts of my wordsToFind.
Example
wordsToFind = {"tes","don"};
StringListElement = {"test", "done"}
Should return on my select.
How can I do that?