You are previewing Essential LINQ.

Essential LINQ

Cover of Essential LINQ by Charlie Calvert... Published by Addison-Wesley Professional

Chapter 9. Modifying Objects with LINQ to SQL

Querying is the focus of all LINQ components, as the name Language Integrated Query suggests. However, applications that use relational data as objects need to go beyond querying by making changes to the retrieved objects and saving them back to the database. LINQ to SQL complements the LINQ query pattern with a simple API to modify and save objects.

Relational databases use SQL commands to insert, update, and delete rows. The LINQ pattern currently does not cover such commands because they are very specific to the relational domain. Furthermore, for most applications, it is more natural and efficient to work with objects and in-memory collections to modify objects until all the changes are done. ...

The best content for your career. Discover unlimited learning on demand for around $1/day.