-
Notifications
You must be signed in to change notification settings - Fork 30
StructureMap
StructureMap is one of the first containers created for .NET. It has two syntax flavors, the older, more verbose one (now considered obsolete), and the newer, less verbose but fluent. Only the newer syntax is supported.
The following methods are supported both in a container instance or as instance members of a Registry.
-
For<IFoo>().Use<Foo>() -
For(typeof(IFoo)).Use(typeof(Foo)) -
For<IFoo>().Add<Foo>() -
Scan -
WithDefaultConventions() -
TheCallingAssembly() -
AddAllTypesOf<T>() -
AddAllTypesOf(typeof(T)) -
Assembly()- currently supportsAssembly.GetExecutingAssembly()andtypeof(Foo).Assembly. Other assembly sources, including local variables are currently not supported. -
AssemblyContaining<T>() -
AssemblyContaining(typeof(T)) -
ExcludeNamespace() -
ExcludeNamespaceContainingType<T>() -
ExcludeType<T>() -
IncludeNamespace() -
IncludeNamespaceContainingType<T>() -
RegisterConcreteTypesAgainstTheFirstInterface() -
SingleImplementationsOfInterface()
Scan-
Exclude- this requires reflection, and it's currently not supported AssembliesFromApplicationBaseDirectory()AssembliesFromPath()