So I'm in the end of making a reading game for children when I see that I sometimes have duplicate words. So I think to myself, lets do a Distinct. But it's a bit more complex.
So I understand how to use Distinct on a list of integers or strings and how to use DistinctBy() on a property within a list.
But what I can't figure out is how to do this on a property within a list of strings that is within a list of objects.
Plan B is a hole lot of ForEaches but I'm looking for something more elegant.
So this is the structure:
List<MyObject>()
{
OtherObject BsObject1;
OtherObject BsObject2;
List<String>();
}
So the date looks like this:
MyObject1: List<String>: "word1", "word2"
MyObject2: List<String>: "word3", "word4"
MyObject3: List<String>: "word1", "word5"
MyObject4: List<String>: "word5", "word6"
As soon as 1 word is in within any of the other list that word that object can be deleted.
Any ideas?