سؤال

I've created a simple PRISM application with a standard bootstrapper inherited from UnityBootstrapper.

The UnityBootstrapper in turn has the public property IUnityContainer and this interface has the following resolve singature:

object Resolve(Type t, string name, params ResolverOverride[] resolverOverrides);

Now, I don't know how to get the other resolve methods which are described here.

Am I confusing Unity with its IUnityContainer interface?

هل كانت مفيدة؟

المحلول

In Unity 1.2, IUnityContainer had all of those overloads available.

In Unity 2.0, you need to bring UnityContainerExtensions in scope because the overloads you want are defined as extension methods on this class.

نصائح أخرى

These methods are extension methods

Signature:

public static T Resolve<T>(this IUnityContainer container, params ResolverOverride[] overrides);

So if you have implemented IUnityContainer you can use them.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top