Walaa wrote:
Why do you copy fields instead of just refreshing/refetching/replacing the in-memory entities.
Refresh/refetch is not an option. Now I have the advantage that all objects are fetched asynchronous. I also don't know what objects to fetch in advance. I fetch async all objects from a table with a timestamp higher then the last "fetch timestamp". After I've fetched these in thread X, I need to synchronize this with the UI thread.
Replacing doesn't work because of binding to the original object. It might be currently edited and that would mean I have two instances of the same object. I know that a context prevents this, but then I cannot go multithreaded. Replacing an object would also lose all data that is not stored in llblgenpro fields. We inherit these objects to expand them with "other" non data properties.
I have to admit that I don't use llblgenpro out of the book, because I have some very specific needs from my app. Limited amount of data that refreshes often and of which people expect live updates.
threadpool gets me all objects where table.Version > @lastversion.
Synchronize objects with UI thread
Merge objects inside existing collections and screens.
if object existed before, merge object in old instance, check sorting on all collections
if new object, insert inside collections
kind regards
a