LLBLGen v2.5 - Adapter
Hello!!!
I am working with a window that displays a list of Clients in a gridview, and when desire edit a record, open a new window with the detail of each field of the record selected.
Today, when I select a record in the gridview, I call a function that takes the selected ClientEntity (ListClientsBS.CurrentRow) and clone this(use memoryStream). This new entity cloned is sent to the new edition window, and once the edition is finally and save, a series of actions (agent events) reflect this change in the gridview (even if add one new ClientEntity).
This works perfect and allows me to work without reflect changes in the gridview at editing fields in detail view (or even if I cancel edition) until i save changes.
This I did to avoid refetch individual entities since the database (simply taken one from the list and the showed locally), but now that I am testing with large amounts of data, I see that the cloned by means of memoryStream consumes much memory because I read the graph complete and is slow (more than refetch an entity from the server).
The question is, which is the method that use you or which is the most suitable for this type of scenarios?
The idea was not consume network resources, but perhaps more expensive clone entities to bring some simple data from the network. The implementation would be conducted in an local client server environment , nothing of distributed scenarios or remote or connected/disconnected.
For now I am occur two ideas:
**
1- Take the Id of the entity selected, pass the Id at the view of edition and refetch the entity from the database with all their relations. (Simple code, but refetch one existent entity)
2- Clone each field of entity individually (Client.Fields.Cone; Client.Order.Field.Clone; etc.) (disadvantage: more code and checks of invalidity for each relationship).
**
Thank you and I hope their view points and contributions.
Regards!!!