Anyone know a good book or post about how to start in EF? I have seen the DnrTV any other place?
If we have multiple DbContexts with the same connection then the connection should be disposed of whenever the first closes the connection. Similarly things should happen for the mixed mode of ADO.Net and Entity Framework. DbContext always closes the connection when it is disposed of.
Don't dispose DbContext objects. Although the DbContext implements IDisposable , you shouldn't manually dispose it, nor should you wrap it in a using statement. DbContext manages its own lifetime; when your data access request is completed, DbContext will automatically close the database connection for you.
So if you have more than one DbContext with the same connection whichever context is disposed first will close the connection (similarly if you have mixed an existing ADO.NET connection with a DbContext, DbContext will always close the connection when it is disposed).
Mike Taulty's Blog: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/category/1024.aspx
A great EF intro deck: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/03/13/10235.aspx
And these ADO.NET Data Services screencasts are nice too: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/01/25/10152.aspx
ADO.NET Entity Framework MSDN: http://msdn.microsoft.com/en-us/library/bb399572.aspx
ADO.NET Entity Framework forums: http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=533&SiteID=1
ADO.NET team blog: http://blogs.msdn.com/adonet/archive/tags/Entity+Framework/default.aspx
Programming LINQ and the ADO.NET Entity Framework Webcast: http://blogs.msdn.com/adonet/archive/2008/01/28/programming-linq-and-the-ado-net-entity-framework-webcast.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With