Register an instance as a component.
| C# | Visual Basic | Visual C++ |
public static IRegistrationBuilder<T, SimpleActivatorData, SingleRegistrationStyle> RegisterInstance<T>( ContainerBuilder builder, T instance ) where T : class
Public Shared Function RegisterInstance(Of T As Class) ( _ builder As ContainerBuilder, _ instance As T _ ) As IRegistrationBuilder(Of T, SimpleActivatorData, SingleRegistrationStyle)
public: generic<typename T> where T : ref class static IRegistrationBuilder<T, SimpleActivatorData^, SingleRegistrationStyle^>^ RegisterInstance( ContainerBuilder^ builder, T instance )
- T
- The type of the instance.
- builder (ContainerBuilder)
- Container builder.
- instance (T)
- The instance to register.
Registration builder allowing the registration to be configured.
If no services are explicitly specified for the instance, the
static type T will be used as the default service (i.e. *not*
CopyC#).
instance.GetType()