Guest User

Untitled

a guest
May 6th, 2012
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Declare generic type parameter as having a destructor?
  2. public class EntityContextFactory<T>
  3. where T: class, IDisposable, IObjectContextAdapter, new()
  4.  
  5. T context = HttpContext.Current.Items[objectContextKey] as T;
  6. if (context != null)
  7. {
  8. context.Dispose();
  9. GC.SuppressFinalize(context);
  10. HttpContext.Current.Items.Remove(objectContextKey);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment