If I have an object of type Person and it has a navigation property of PersonAddressJoin which then has addresses.
PersonResults= new ObservableCollection<Person>(_op.Entities.OfTy开发者_如何学Cpe<Person>());
and I want to then take the PersonAddressJoin navigation property and put that into an object. so i have an ObservableCollection AddressList
AddressList = PersonResults.SelectMany(x => x.PersonAddressJoins);
when i do it this way I get a message that says I cant cast an IEnumberable to an ObservableCollection.?
Can someone help me get that navigation property into this object...thanks
The result of SelectMany is an IEnumerable. Untested, but try:
AddressList = new ObservableCollection<PersonAddressJoins>(PersonResults.SelectMany(x => x.PersonAddressJoins)); 
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论