Class RegisterOptions
Registration options for "fluent" API.
Inherited Members
Namespace: Swan.DependencyInjection
Syntax
public sealed class RegisterOptions
Constructors
RegisterOptions(TypesConcurrentDictionary, DependencyContainer.TypeRegistration)
Initializes a new instance of the RegisterOptions class.
Declaration
public RegisterOptions(TypesConcurrentDictionary registeredTypes, DependencyContainer.TypeRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
TypesConcurrentDictionary | registeredTypes | The registered types. |
DependencyContainer.TypeRegistration | registration | The registration. |
Methods
AsMultiInstance()
Make registration multi-instance if possible.
Declaration
public RegisterOptions AsMultiInstance()
Returns
Type | Description |
---|---|
RegisterOptions | A registration options for fluent API. |
Exceptions
Type | Condition |
---|---|
DependencyContainerRegistrationException | Generic constraint registration exception. |
AsSingleton()
Make registration a singleton (single instance) if possible.
Declaration
public RegisterOptions AsSingleton()
Returns
Type | Description |
---|---|
RegisterOptions | A registration options for fluent API. |
Exceptions
Type | Condition |
---|---|
DependencyContainerRegistrationException | Generic constraint registration exception. |
WithStrongReference()
Make registration hold a strong reference if possible.
Declaration
public RegisterOptions WithStrongReference()
Returns
Type | Description |
---|---|
RegisterOptions | A registration options for fluent API. |
Exceptions
Type | Condition |
---|---|
DependencyContainerRegistrationException | Generic constraint registration exception. |
WithWeakReference()
Make registration hold a weak reference if possible.
Declaration
public RegisterOptions WithWeakReference()
Returns
Type | Description |
---|---|
RegisterOptions | A registration options for fluent API. |
Exceptions
Type | Condition |
---|---|
DependencyContainerRegistrationException | Generic constraint registration exception. |