SplatContainerExtension.RegisterSingleton(Type, Type) method¶
Defined in
Type: SplatContainerExtension
Namespace: Splat.Prism
Assembly: Splat.Prism.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481, net471
Overloads¶
- 1.
public IContainerRegistry RegisterSingleton(Type from, Type to) - 2.
public IContainerRegistry RegisterSingleton(Type from, Type to, Func<object> defaultCreationFunc) - 3.
public IContainerRegistry RegisterSingleton(Type from, Type to, string name, Func<object> defaultCreationFunc) - 4.
public IContainerRegistry RegisterSingleton(Type from, Type to, string name) - 5.
public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod) - 6.
public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)
1. Overload¶
public IContainerRegistry RegisterSingleton(Type from, Type to)
Inherited documentation
These docs were inherited from IContainerRegistry. The member doesn't override them on this type.
Parameters
| Name | Type | Description |
|---|---|---|
from | Type | -- |
to | Type | -- |
Returns: IContainerRegistry
2. Overload¶
public IContainerRegistry RegisterSingleton(Type from, Type to, Func<object> defaultCreationFunc)
Summary: Registers an object with the default registration func.
Parameters
| Name | Type | Description |
|---|---|---|
from | Type | The type to transform from. |
to | Type | The type to transform to. |
defaultCreationFunc | Func | A creation func for generating the type. |
Returns: IContainerRegistry -- The container registry for builder operations.
3. Overload¶
public IContainerRegistry RegisterSingleton(Type from, Type to, string name, Func<object> defaultCreationFunc)
Summary: Registers an object with the default registration func.
Parameters
| Name | Type | Description |
|---|---|---|
from | Type | The type to transform from. |
to | Type | The type to transform to. |
name | string | The contract name. |
defaultCreationFunc | Func | A creation func for generating the type. |
Returns: IContainerRegistry -- The container registry for builder operations.
4. Overload¶
public IContainerRegistry RegisterSingleton(Type from, Type to, string name)
Inherited documentation
These docs were inherited from IContainerRegistry. The member doesn't override them on this type.
Parameters
| Name | Type | Description |
|---|---|---|
from | Type | -- |
to | Type | -- |
name | string | -- |
Returns: IContainerRegistry
5. Overload¶
public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)
Inherited documentation
These docs were inherited from IContainerRegistry. The member doesn't override them on this type.
Parameters
| Name | Type | Description |
|---|---|---|
type | Type | -- |
factoryMethod | Func | -- |
Returns: IContainerRegistry
6. Overload¶
public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)
Inherited documentation
These docs were inherited from IContainerRegistry. The member doesn't override them on this type.
Parameters
| Name | Type | Description |
|---|---|---|
type | Type | -- |
factoryMethod | Func | -- |
Returns: IContainerRegistry