neoech / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

AutofacDomainServiceFactory creates instances in the root container #303

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The constructor of AutofacDomainServiceFactory() in the RIA Services 
integration takes an IContainer in its constructor. Because it creates 
instances directly through the container, these are all singletons or else 
leaked through the root container.

As a workaround, it is possible to create ADSF with a 
ContainerProviderContainer:

var dsf = new AutofacDomainServiceFactory(
    new ContainerProviderContainer(_containerProvider));

To fix the problem, ADSF must accept only an IContainerProvider as its 
constructor parameter, and use the request lifetime appropriately.

(An additional challenge will be to make this work with the new MVC3 
integration, which does not use IContainerProvider.)

Carl: please assign this back to me if you're unable to take a look at this - 
thanks! :)

Original issue reported on code.google.com by nicholas...@gmail.com on 28 Feb 2011 at 9:29

GoogleCodeExporter commented 9 years ago

Original comment by travis.illig on 21 Sep 2012 at 4:31

GoogleCodeExporter commented 9 years ago
I'll take this for the Autofac 3 release.

Original comment by travis.illig on 4 Dec 2012 at 1:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8ed06b4c6f19.

Original comment by travis.illig on 4 Dec 2012 at 1:32