The DataContext

In most of the previous LINQ to SQL chapters, I reference the DataContext class but have yet to fully explain it. In this chapter, I remedy this oversight.

In this chapter, I explain the DataContext class, what it can do for you, and how to make the most of it. I discuss all of its major methods and provide examples of each. Understanding the DataContext class is necessary to successfully employ LINQ to SQL, and by the time you have read this chapter, you should be a master of the DataContext class.

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.