tags:

views:

179

answers:

2

Is there a way to determine if a specific type has been configured in StructureMap?

I want to return a generic type if it has not be specifically configured in StructureMap.

+2  A: 

From StructureMap version 2.5.1 there is a TryGetInstance<T>() and TryGetNamedInstance<T>() which will return the default value of T if T is not known.

Jon Cahill
If `T` is *not known* ? did u mean : if `T` is *known* ?
Pure.Krome
+2  A: 

In v2.6 you want:

IContainer.Model.HasImplementationsFor(serviceType)
Andrew Bullock