Example Model: Customer -> Order
contex.Order.Load();
orderBindingSource.DataSource = context.Order.Local().ToBindingList();
Then, how to filter? e.g. context.Order.Where(m=>m.customerID > 1)
I want to get the BindingList implementation that stays in sync with the ObservableCollection returned by the Local property.
Have you tried using select?
contex.Order.Load();
orderBindingSource.DataSource =
context.Order.Local().Select( m => m.customerID > 1).ToBindingList();
Edit
Not entirely sure about this, it compiles but I do not have a full environment to test it. Perhaps if you try to load in the specific data, and then you can access it in local for the binding list. Like this:
context.Order.Select( m => m.customerID > 1).Load();
orderBindingSource.DataSource =
context.Order.Local.ToBindingList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With