I'm using EF6 and VB.net 2017. I have this code :
context.Entry(Myobj1).Collection("Child_Itm").Load()
bindingsource1.datasource=context.Child_itm.Local.Tobindinglist
The problem is that , after that at some point i want to load the child collection for another object like this :
context.Entry(Myobj2).Collection("Child_Itm").Load()
bindingsource1.datasource=context.Child_itm.Local.Tobindinglist
But after that , on my bindingsource the are all the items loaded from the first and the second call of load. How can i do to clear the local collection before loading new data ? Before calling the second load , I've tried with :
context.child_itm.local.clear
, but the objects still exist on local. I want to remove all items , and not keeping even on Detached status But i want to do that without disposing the context.
Is there any way ?