Please help! I am developing a wpf application with ef core. After reading the Microsoft documentation, I found it convenient to bind my DataGrid to a collection DbSet< T >.Local:
it represents a local view of all Added, Unchanged, and Modified entities in this set. This local view will stay in sync as entities are added or removed from the context.
Everything works great, but there is a small problem: Now I can only make synchronous queries to DB through the context, which often freeze the UI. Asynchronous queries throw an exception:
This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.
Is there a way how to bind to this Local and keep the possibility of asynchronous queries through the context?
Here is the simplest test(no MVVM etc): https://github.com/OlegFj17/TestingBindingToLocal_EF_6
Thank you.