Datacontext submitchanges not updating database
I suppose I see why this might not exist due to complications with child entity objects.
The other alternative AFAIK is to create a Copy From Entity To Entity extension method or class method to copy from the object you wish to update, to an object acquired from the database during the update method.
Recently, I have discussed about getting started linq to sql in c#
That articles also covered for creating select query for retrieving both single and multiple results.
Thus, it is convenient if the ORM solution tracks all data changes done in the application, and saves all of them in a transactional way at a single moment specified by the developer.
The same as for querying, this is done via the Data Context class in Linq Connect.
Another important thing about persisting the modifications is that it should be transactional for most of the common scenarios.
This also assumes the PK is a GUID[uniqueidentifier] field. void Update(orders_main Table update Entity, Guid identifier) The Copy From method would iterate over the reflected values of the objects and copy the data from the “update Entity” object to the original object. LINQ-to-SQL should be smart enough to take care of this for [us] automatically in my opinion.
but even those require some nasty stuff, some hard coding of methods in the Data Context class itself, and/or adding versioning field to your database table.