Finding the DataContext for a Single Linq To Sql Object

February 12, 2008 14:14 by admin

Patrik Löwendahl has created an extension method that returns the DataContext of the object passed to it.

Usage would be:

DataContext context = propduct.GetDataContextFromMe();

or

NorthwindDataContext = product.GetDataContextFromMe<NorthwindDataContext>();


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 19. 2008 20:32