tag:blogger.com,1999:blog-2933401848965498544.post7818872635839807247..comments2023-10-26T07:28:36.575-04:00Comments on Sit Down Waldo!: Another Entity Framework 4 Repository & Unit of Work Solution–Intro and Part 1: Setuptdryanhttp://www.blogger.com/profile/17038688255673658684noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-2933401848965498544.post-62084577512907140602011-03-29T18:12:37.180-04:002011-03-29T18:12:37.180-04:00Sorry to Bug You, but i have one more question on ...Sorry to Bug You, but i have one more question on the Article (im an absolute beginner to EF4, SoC paradigm).<br /><br />So, The EF4_T4 template Generates IServices in Core proj and The Infrastructure Project implements those. So, according to DDD, do i assume Infrastructure is my BLL, and implement a Constructor with Respective IRepositiory and initialize it as done in Web-> Models - > Albums -> AlbumGridViewModelBuilder.cs?<br /><br />Essentially i need to provide Concrete implementation for Services in the Infrastructure Project and use them in my Web Pages?Unknownhttps://www.blogger.com/profile/03748239327377900325noreply@blogger.comtag:blogger.com,1999:blog-2933401848965498544.post-47870032464998205692011-03-29T13:29:12.434-04:002011-03-29T13:29:12.434-04:00I suppose your scenario is possible via structurem...I suppose your scenario is possible via structuremap's constructor (with parameters) injection; however, I don't recall ever injecting parameters (FWIW - that's a very odd requirement - per-user connection string). EF Object Context requires metadata (used for ORM mapping) in the connection string, making property injection a bit more challenging. I believe structuremap also supports parameterized strings, so you could have a connection string with {0} -based templates (containing the full connection string with {0} templates for the respective user name/id) and inject the user with string.Format. I recommend that you throw a question out on <a href="http://stackoverflow.com/" rel="nofollow">StackOverflow</a> presenting your specific (or similar) scenario. I know that doesn't specifically answer your question, but hopefully that points you in the right direction. Good luck Akhil... -Dantdryanhttps://www.blogger.com/profile/17038688255673658684noreply@blogger.comtag:blogger.com,1999:blog-2933401848965498544.post-63729966167795200922011-03-29T13:06:15.901-04:002011-03-29T13:06:15.901-04:00Sure, it did. Thank You.
Also, i have a requireme...Sure, it did. Thank You.<br /><br />Also, i have a requirement where in the Object Context Provider Connection String needs to be based on User Login (using Forms Authentication, and membership). Is there a Thread Safe way (per HTTP Request) to Inject Dependency Dynamic Connection String From Session?<br /><br />Thanks.Akhil Parasahttps://www.blogger.com/profile/11760439625033085674noreply@blogger.comtag:blogger.com,1999:blog-2933401848965498544.post-38647428412154232342011-03-29T07:53:06.530-04:002011-03-29T07:53:06.530-04:00Thanks for the comment Akhil. The concept of Depe...Thanks for the comment Akhil. The concept of Dependency Injection is a bit convoluted in Web Forms as Web Forms Page and User Controls (via Page/UserControl classes) do not support constructor injection. You could potentially use property injection or just instantiate objects like you would normally do; however, this approach is not conducive to unit testing. The following contains a couple of snippets for DI registration in non-IDependencyResolover supported scenarios: <a href="http://tdryan-bin.blogspot.com/2011/03/dependency-injection-di-registration.html" rel="nofollow">Link</a>. I hope this helps...tdryanhttps://www.blogger.com/profile/17038688255673658684noreply@blogger.comtag:blogger.com,1999:blog-2933401848965498544.post-82042639710285850882011-03-28T22:59:28.006-04:002011-03-28T22:59:28.006-04:00Could you Provide a basic sample implementation fo...Could you Provide a basic sample implementation for WebForms? as IDependencyResolver seems to be an MVC 3 concept.<br /><br />Thank You.Akhil Parasahttps://www.blogger.com/profile/11760439625033085674noreply@blogger.comtag:blogger.com,1999:blog-2933401848965498544.post-72096237245442171092011-03-28T21:11:29.205-04:002011-03-28T21:11:29.205-04:00Thanks a lot Ryan. This really helped me a lot. Gr...Thanks a lot Ryan. This really helped me a lot. Great detailed approach for beginners.Unknownhttps://www.blogger.com/profile/03748239327377900325noreply@blogger.com