LINQ to SQL Database Operations

In this chapter, I will discuss and demonstrate how all of the typical database operations are performed with LINQ to SQL. Specifically, I will cover how to perform

  • Inserts

  • Queries

  • Updates

  • Deletes

After I discuss the standard database operations, I will demonstrate how you can override the default insert, update, and delete methods an entity class uses to persist changes to the database.

The last topic I will cover is the automatic translation of LINQ to SQL queries, including what to be mindful of when writing queries.

In order to discuss the standard database operations, I will have to refer to the DataContext and relevant entity classes. I am aware that I have not provided much detail yet as to how entity classes ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.