dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

Ability to Configure() host and request containers through fluent API #27

Closed vzwick closed 6 years ago

vzwick commented 7 years ago

Similar to #26 - we have a number of things that we need to set up on the host and request container levels, requiring direct access to the respective container's StructureMap.ConfigurationExpression.

I've cobbled together a rather hacky solution that adds ConfigureHostContainer(Action<ConfigurationExpression> configure) and ConfigureRequestContainers(Action<ConfigurationExpression> configure) methods to AdaptedContainerBuilderOptions<TTenant>

Would this be something that you would be interested in adding to the core of Dotnettency?

dazinator commented 7 years ago

Hmm not sure. Think I would need to see more details of the proposed API changes. In theory I am open to it, but at the same time, I can't afford to pollute particular abstractions with container specific implementations. So as long as the container specific stuff is in an appropriate place then I am fine with it.

vzwick commented 7 years ago

At the moment, you definitely won't like it - hence no PR ;)

I'm thinking of rewiring it using a marker interface (that would live in Dotnettency.Container) and leaving it up to the individual container adapters to provide an implementation by way of extension methods.

dazinator commented 7 years ago

I'm thinking of rewiring it using a marker interface (that would live in Dotnettency.Container) and leaving it up to the individual container adapters to provide an implementation by way of extension methods.

That sounds more in line with the path I am on!

dazinator commented 6 years ago

Closing as no action in a while. Reopen if necessary