I’ve an ObservableCollection which includes another ObservableCollection.
ObservableCollection<MyModel> models = new ObservableCollection<MyModel>();
My models looks like that:
public class MyModel
{
public ObservableCollection<MyModel2> list2 { get; set; }
public string Property1 { get; set; }
}
public class MyModel2
{
public string Property2 { get; set; }
public string Property3 { get; set; }
}
Now I want to find all MyModel2 items in models which “Property2” == “test1” and “Property3” == “test2”
I know how to search in just one list2 to find the right items, but i want to search in all “list2” in the models-collection.
var result = from mod
in list2
where mod.Property2 == "test1" && mod.Property3 == "test2"
select mod;
Any help would be grateful.
It sounds like you want something like:
Or in non-query expression form: