ObservableCollection<MainBusinessObject>
を持つコレクション内のすべてのアイテムをフィルタリングする必要がある場所をフィルタリングしようとしていますSubobject.PropertyX == true
。
MainBusinessObject
- PropertyA int
- PropertyB string
- ListOfSubobject ObservableCollection<Subobject>
Subobject
- PropertyX bool
- PropertyY int
- PropertyZ - string
ループと if ステートメントを避けたいのですが、LinQ ステートメントを正しく取得できないようです。これは私がこれまでに持っているものです:
return (MainBusinessObjectCollection)
listOfMainBusinessObject.Where(x =>
(x as MainBusinessObject).CanBePartitioned == true);
編集ListOfSubobject
メインのビジネスオブジェクトから除外する
必要があります