0

Are these statements equivalent (Am I getting the same object)?

unity.Resolve<ITest>();

and

unity.Resolve<ITest>(name : null);

If not what is the default name when I register without passing in the name parameter?

Eg. when I do this:

unity.RegisterType<ITest,Test>();

1 Answer 1

1

They are equivalent and you will get the same type. The generic RegisterType methods are in fact extension methods, and all of them call the same method on UnityContainer.

IUnityContainer RegisterType(Type from, Type to, string name, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.