Determine if a specific type of StructureMap is configured?

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

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

+4
source share
2 answers

In v2.6 you want:

IContainer.Model.HasImplementationsFor(serviceType) 
+12
source

From StructureMap version 2.5.1, there are TryGetInstance<T>() and TryGetNamedInstance<T>() , which will return the default value T if T unknown.

+4
source

All Articles