Linq submitchanges not updating

15 Mar

The idea is that you have wrapper methods for CRUD (and all other data access) in the business layer so you'd write code like this: True this doesn't look much different than using the LINQ objects directly but the big difference is that you get some level of abstraction for the load and update code so you can inject things like tracing and error handling etc.

So to implement you might use code like this for the Load: and another routine later on that saves this object (assuming that possibly the context has gone away).

But for the application, the object state not being saved is clearly an error, so Linq Connect throws Change Conflict Exception (the text is usually "Row not found or changed.").

linq submitchanges not updating-33linq submitchanges not updating-19linq submitchanges not updating-18

I am assuming, you already know how to create dbml/linq to sql classes: Being Lin Q as a ORM, it’s quite easy and sql syntax free way to insert data using Lin Q.I am playing around with LINQ to SQL in conjunction with business objects.So rather than using LINQ directly in the front end UI I want an abstraction layer.One problem that I can't seem to resolve with the data context is how to update Entities based on POCO objects that didn't originate out of the Data Context.LINQ wants to manage all objects through its data context which basically manages change tracking for any entities - any changes you make can later be persisted.