zcz527 / autofac

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

Add configuration event to AutofacHostFactory/AutofacServiceHostFactory #322

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the default AutofacHostFactory/AutofacServiceHostFactory and .svc files, 
there is no way to add programmatic configuration to the generated service 
hosts (e.g., additional behaviors) without creating your own custom factory.

It would be much more convenient if, rather than have to derive/override and 
have an entirely new factory, you could simply subscribe to an event that 
indicates when the factory is creating a new host and lets you do things at 
that time.

The AutofacContrib.Multitenant solution supports this by having an action you 
can set on the factory...

public static Action<ServiceHostBase> HostConfigurationAction { get; set; }

...and then calling that action when a service host is created (if it's not 
null). It allows for simple additions to the service host factory without a 
custom factory implementation.

Original issue reported on code.google.com by travis.illig on 25 Apr 2011 at 3:16

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 25 Apr 2011 at 3:16

GoogleCodeExporter commented 8 years ago
Thanks Travis. If you have any time to jump in and make these changes please 
feel free. Cheers!

Original comment by nicholas...@gmail.com on 9 May 2011 at 8:47

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 10 May 2011 at 6:48

GoogleCodeExporter commented 8 years ago
Resolved in changeset 5672272b5841.

Original comment by travis.illig on 10 May 2011 at 7:17