Saving changed data

Topics: User Forum
Dec 19, 2006 at 12:27 PM
I copy here the question I made to you in italian from your blog contact form.

In your example form using your RafCollection seems to be not implemented yet the "Save to DB" part of the code. A modification inside an entity doesn't seems to be updated in the Northwind database.
Is it correct? What is the basic step to make it functional?

Thanks
Mauro Destro
Coordinator
Dec 19, 2006 at 5:57 PM
Hi Mauro,
as I wrote in the documentation, the DAL is just an idea that I used in some project and I also included for testing the collection.
The update part of the DAL is not a "general" implementation so it's only a matter of launching commands to update the DB.
I also think it's not very useful to implement a general implementation because DLinq will be available (sooner or later) and that will be (hopefully) the best solution.
Sorry, anyway you can easily implement your own methods to update:
- test for HasChanged
- apply a state filter to get only the modified/deleted/inserted objects
- loop for those objects and run one or more command for each object to be inserted/updated/deleted.
That should not be difficult at all.
Ciao!