Forum:  LLBLGen Pro Runtime Framework

Thread:  Refresh EntityCollection from database


Rosacek (User)   Posted on: 13-Sep-2012 21:58:53.
Hi,
what is the right way to refresh entitycollection from database?

When simply use following code, only new records from DB are added to entitycollection, but updated records are not affecting my entity collection.

Code:

Using adapter As New DataAccessAdapter()
         adapter.FetchEntityCollection(ecCustomers, Nothing)
End Using


It works fine if I call ecCustomers.Clear() first, and then fetch
Code:

Using adapter As New DataAccessAdapter()
         ecCustomers.Clear()
         adapter.FetchEntityCollection(ecCustomers, Nothing)
End Using


Is there any better way how to refresh from DB?
daelmo (Support Team)   Posted on: 14-Sep-2012 06:55:22.
Clearing the collection is a good idea actually, also because may be elements that are not anymore in DB.