Question

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.

Was it helpful?

Solution

In v2.6 you want:

IContainer.Model.HasImplementationsFor(serviceType)

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top