Hi,
I use context to have unique entity instance because of prefetch paths.
I am curious what is the best practice when I need to reload entitycollection (added to a context) from DB and a filter is changed between reloads.
For example in the first LoadData call, I want entities having .IsActive=TRUE
And then in the second call I want entities having .IsActive=FALSE
If I do not clear myContext, then I will have both active and inactive entities in context.
As I use context just to enforce uniqueness, I think, there is not necessary to call myContext.Clear while reloading data.
Public Sub LoadData(filter As IRelationPredicateBucket)
Using adapter As New DataAccessAdapter
myContext.Clear '???????? necesary?
ecol.Clear()
adapter.FetchEntityCollection(ecol, filter, 0, Nothing, prefetchPath)
End Using
End Sub