Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResolverOverride cannot be used for ctor with RegisterType<interface,className> #1

Open
itsho opened this issue Feb 21, 2019 · 0 comments

Comments

@itsho
Copy link

itsho commented Feb 21, 2019

Hi.

In case you use interface to register a type

unityContainer.RegisterType<IFoo, Foo>(new ContainerControlledLifetimeManager());

we won't be able to use a parameterized ctor since we cannot add a ctor to the interface.

so basically, this example:

var myObj = unity.Resolve<MyClass>(new ResolverOverride[]

will only work when registering an instance directly.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant