tag:blogger.com,1999:blog-4063545436138319205.post2421913238826506944..comments2024-03-28T20:55:32.820-07:00Comments on Tom DuPont .NET: Understanding Unity Lifetime ManagersTom DuPonthttp://www.blogger.com/profile/08233783264428691459noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4063545436138319205.post-11471062342002431342018-05-03T09:09:58.006-07:002018-05-03T09:09:58.006-07:00Here is blog - telling about how to inject EF DbCo...Here is blog - telling about how to inject EF DbConext <br /><br />https://rajeevdotnet.blogspot.com/2017/08/dependency-injection-with-DbContext.html<br />Rajeev Tiwarihttps://www.blogger.com/profile/04441034939928336455noreply@blogger.comtag:blogger.com,1999:blog-4063545436138319205.post-75688406446191239322014-07-08T05:57:14.941-07:002014-07-08T05:57:14.941-07:00Thanks for posting this -- you've explained al...Thanks for posting this -- you've explained all of the lifetime managers clearly and concisely! :)<br /><br />One of the things I've been struggling with is trying to find a way to get Unity to instantiate Entity Framework DbContexts, one per request, and dispose of them. But I guess the problem is: how would the context know it's safe to dispose? Perhaps that's why I haven't been able to find something that would do the trick? I'm currently disposing of these DbContexts non-determinalistically in the destructors of my repository classes: hardly a pefect solution, but at least the DbContexts get disposed...eventually. Any thoughts/advice?Alanhttps://www.blogger.com/profile/14978517118599802301noreply@blogger.comtag:blogger.com,1999:blog-4063545436138319205.post-8216771182248211532014-01-17T20:30:17.563-08:002014-01-17T20:30:17.563-08:00You are very welcome.You are very welcome.Tom DuPonthttps://www.blogger.com/profile/08233783264428691459noreply@blogger.comtag:blogger.com,1999:blog-4063545436138319205.post-22392140610004068832013-12-31T11:56:18.753-08:002013-12-31T11:56:18.753-08:00thanks Tom, this was a useful unity review.thanks Tom, this was a useful unity review.Danhttps://www.blogger.com/profile/09340593030309353368noreply@blogger.com