Monday, February 01, 2010

9 LINQ to SQL Tips by Dinesh Kulkarni

  1. How to map an enum
  2. How to use common base class for all entities
  3. Deferred (lazy) or eager loading of related objects with stored procs
  4. Use DeleteOnNull if you want to delete object with null FK
  5. Using stored procs that return multiple results
  6. How to refresh given DataContext won't stomp on your objects
  7. Minimal update when you don't want optimistic concurrency check
  8. How to (and why) create a partial class in the designer to augment generated code
  9. Understanding DataContext's internal caching
Dinesh Kulkarni is one of the developers behind my favorite .NET 3.5 feature, linq to sql (aka dlinq). He has a series of tips that are not organized so I decided to organize them here. Anyone who uses or plans to use linq to sql should read every tip because these tips address the most common questions he has been asked.

1 comment:

Leuke said...

Your posts always confuse me.