Geeks With Blogs
Darren Fieldhouse December 2011 Entries
ObjectDisposedException in Entity Framework
Having just help another developer with this issue, I thought I’d write a quick post about the cause of the ObjectDisposedException exception when working with Entity Framework. It is important to be aware of two things when working with Entity Framework 1) The data context must not be disposed of until all the data is fetched from the database. 2) A linq statement creates an IQueryable, which is not executed until you enumerate over it (e.g. use it in a for each loop) or convert it to a list or ......

Posted On Monday, December 12, 2011 5:57 AM

Copyright © DarrenFieldhouse | Powered by: GeeksWithBlogs.net