I am trying to update using LINQ that encapsulates the business logic in a separate layer. This is working fine with SELECT, INSERT and DELTE LINQ queries, but UPDATE statements are proving a bit of a headache.
I have tried using the db.Attach method but that is failing when there is more that one table being updated, which is pretty much 99% of the time.
The error I am getting is: "System.NotSupportedExcept
ion: An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported."
Should I be using multiple data contexts?