I have to say, I started using Linq to SQL a couple of months ago, but it is a very powerful feature.
Just a couple of queries.
1.
Linq apparently keeps a memory copy of the objects it maps, but it is recommended that changes to those memory objects should be commited using submitallchanges() at the earliest opportunity.
In my application, I essentially wanted to keep a memory copy of my tables to add, update and delete to and synchronise the memory copy with a load and save operation. I've written a pattern that will received the row type - an extended version of the generated sqlmetal class - which handles all the synchronisation stuff. Am I barking up the wrong tree, or am I correct to respect the advice on the correct usage of the generated code and implement my own synchronisation routines?
2.
Is it me or does the generated class for a row seem incomplete? The On<Field>Changing event doesn't allow any parameters to be passed (like field name), but the On<Field>Changed does.
Just a couple of queries.
1.
Linq apparently keeps a memory copy of the objects it maps, but it is recommended that changes to those memory objects should be commited using submitallchanges() at the earliest opportunity.
In my application, I essentially wanted to keep a memory copy of my tables to add, update and delete to and synchronise the memory copy with a load and save operation. I've written a pattern that will received the row type - an extended version of the generated sqlmetal class - which handles all the synchronisation stuff. Am I barking up the wrong tree, or am I correct to respect the advice on the correct usage of the generated code and implement my own synchronisation routines?
2.
Is it me or does the generated class for a row seem incomplete? The On<Field>Changing event doesn't allow any parameters to be passed (like field name), but the On<Field>Changed does.