Methods
-
Assert
Configuration Use with caution! Does a full environment test of the configuration of this container. Will try to create every configured instance and afterward calls any methods marked with ValidationMethodAttribute.Is Valid() -
Build
Up(Object) The BuildUp(System.Object) method takes in an already constructed object and uses Setter Injection to push in configured dependencies of that object. -
Configure(Action<Configuration
Expression>) Used to add additional configuration to a Container *after* the initialization. -
Create
Child Creates a new, anonymous child container.Container() -
Eject
All Removes all configured instances of T from the Container. Use with caution!Instances Of``1() -
For
Generic Convenience method to request an object using an Open Generic Type and its parameter TypesType(Type) -
For
Object(Object) Shortcut syntax for using an object to find a service that handles that type of object by using an open generic type. -
Get
All Creates or resolves all registered instances of the pluginType.Instances(Type) -
Get
All Gets all configured instances of pluginType using explicitly configured arguments from args.Instances(Type, Explicit Arguments) -
Get
All Creates or resolves all registered instances of type T.Instances``1() -
Get
All Gets all configured instances of T using explicitly configured arguments from args.Instances``1(Explicit Arguments) -
Get
Instance(Type) Creates or finds the default instance of pluginType. -
Get
Instance(Type, Gets the default instance of pluginType using the explicitly configured arguments from args.Explicit Arguments) -
Get
Instance(Type, Gets the named instance of pluginType using the explicitly configured arguments from args.Explicit Arguments, String) -
Get
Instance(Type, Creates a new instance of the requested type pluginType using the supplied Instance. Mostly used internally.Instance) -
Get
Instance(Type, Creates or finds the named instance of pluginType.String) -
Get
Instance``1() Creates or finds the default instance of T. -
Get
Instance``1(Explicit Gets the default instance of T, but built with the overridden arguments from args.Arguments) -
Get
Instance``1(Explicit Gets the named instance of T using the explicitly configured arguments from args.Arguments, String) -
Get
Instance``1(Instance) Creates a new instance of the requested type T using the supplied Instance. Mostly used internally. -
Get
Instance``1(String) Creates or finds the named instance of T. -
Get
Nested Starts a "Nested" Container for atomic, isolated access.Container() -
Get
Nested Starts a new "Nested" Container for atomic, isolated service location using that named profile's defaults.Container(String) -
Get
Nested Efficiently starts a "Nested" Container using some default servicesContainer(Type Arguments) -
Get
Profile(String) Gets a new child container for the named profile using that profile's defaults with fallback to the original parent. -
Inject(Type,
Object) Injects the given object into a Container as the default for the designated pluginType. Mostly used for temporarily setting up return values of the Container to introduce mocks or stubs during automated testing scenarios. - Inject``1(``0) Injects the given object into a Container as the default for the designated T. Mostly used for temporarily setting up return values of the Container to introduce mocks or stubs during automated testing scenarios.
- Release(Object) If explicit transient tracking is turned on, calling this method will call Dispose() on a transient scoped object that was previously created by this IContainer and remove it from its tracking.
-
Try
Get Creates or finds the default instance of pluginType. Returns null if pluginType is not known to the container.Instance(Type) -
Try
Get Gets the default instance of pluginType using the explicitly configured arguments from args. Returns null if the named instance is not known to the container.Instance(Type, Explicit Arguments) -
Try
Get Gets the named instance of pluginType using the explicitly configured arguments from args. Returns null if the named instance is not known to the container.Instance(Type, Explicit Arguments, String) -
Try
Get Creates or finds the named instance of pluginType. Returns null if the named instance is not known to the container.Instance(Type, String) -
Try
Get Creates or finds the default instance of T. Returns the default value of T if it is not known to the container.Instance``1() -
Try
Get Gets the default instance of T using the explicitly configured arguments from args. Returns the default value of T if it is not known to the container.Instance``1(Explicit Arguments) -
Try
Get Gets the named instance of T using the explicitly configured arguments from args. Returns the default value of T if it is not known to the container.Instance``1(Explicit Arguments, String) -
Try
Get Creates or finds the named instance of T. Returns the default value of T if the named instance is not known to the container.Instance``1(String) -
What
Did Returns a textual report of all the assembly scanners used to build up this ContainerIScan() -
What
Do Returns a report detailing the complete configuration of all PluginTypes and InstancesIHave(Type, Assembly, String, String) -
With(Action<IExplicit
Args Starts a request for an instance or instances with explicitly configured arguments.Expression>) - With(String) Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency or primitive argument with the designated name should be the next value.
-
With(Type,
Object) Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency of pluginType should be arg. - With``1(``0) Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency of T should be arg.
Properties
-
Disposal
Lock Govern the behavior on Dispose() to prevent applications from being prematurely disposed - Model Provides queryable access to the configured PluginType's and Instances of this Container.
- Name The name of the container. By default this is set to a random Guid. This is a convenience property to assist with debugging. Feel free to set to anything, as this is not used in any logic.
-
Profile
Name The profile name of this container. - Role Is this container the root, a profile or child, or a nested container?
-
Transient
Tracking Query or manipulate StructureMap's tracking of transient objects created by this Container. Use with caution.