You are previewing LINQ in Action.

LINQ in Action

Cover of LINQ in Action by Fabrice Marguerie... Published by Manning Publications

Chapter 6. Getting started with LINQ to SQL

This chapter covers:

  • Using LINQ to SQL to access data from SQL Server
  • The advantages of LINQ to SQL for fetching relational data
  • Updating data with LINQ to SQL

So far in this book, we’ve focused on working with data once it is already in memory. In order to query it, we need a group of items we can iterate over using the IEnumerable<T> interface. While the ability to work with data already in memory is a much-needed feature, it fails to address a large part of the picture—moving data to and from a persistence medium, typically a relational database system like SQL Server.

By this point, we should be able to handle a fairly complex LINQ to Objects query. In this chapter, we’re going to take a look ...

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