ContainerRegisterInstance Method

Simple Injector
Overload List

  NameDescription
Public methodRegisterInstanceTService(TService)
Registers a single instance that will be returned when an instance of type TService is requested. This instance must be thread-safe when working in a multi-threaded environment. NOTE: Do note that instances supplied by this method NEVER get disposed by the container, since the instance is assumed to outlive this container instance. If disposing is required, use RegisterSingleton<TService>(Func<TService>).
Public methodRegisterInstance(Type, Object)
Registers a single instance that will be returned when an instance of type serviceType is requested. This instance must be thread-safe when working in a multi-threaded environment. NOTE: Do note that instances supplied by this method NEVER get disposed by the container, since the instance is assumed to outlive this container instance. If disposing is required, use RegisterSingleton(Type, Func<object>).
Top
See Also

Reference