LINQ to SQL and the Entity Framework are very powerful tools, however as in many other useful tools there are some things you should be aware of when working with them. One of those things is object attaching and detaching. Let’s have a concrete example.
As you already know, you can retrieve an object from the database, update or remove it and all the necessary changes will be submitted to the database.
But what if you don’t want to perform additional SELECT query? Instead, you want just to perform one necessary query, either to update an object or remove it. More...