DependencyResolverRegistrar.Register(Func) method¶
Defined in
Type: DependencyResolverRegistrar
Namespace: ReactiveUI
Assembly: ReactiveUI.Core.dll
Applies to
net10.0, net9.0, net8.0, net462, net481
Overloads¶
-
public void Register<TService>(Func<TService> factory) where TService : class -
public void Register<TService>(Func<TService> factory, string? contract) where TService : class
1. Overload¶
public void Register<TService>(Func<TService> factory) where TService : class
Inherited documentation
These docs were inherited from IRegistrar. The member doesn't override them on this type.
Summary: Registers a factory for a service type. The factory function is called each time the service is resolved, creating a new instance.
Type parameters
| Name | Description |
|---|---|
TService | The service type to register. |
Parameters
| Name | Type | Description |
|---|---|---|
factory | Func | A factory function that creates the service instance. |
2. Overload¶
public void Register<TService>(Func<TService> factory, string? contract) where TService : class
Inherited documentation
These docs were inherited from IRegistrar. The member doesn't override them on this type.
Summary: Registers a factory for a service type. The factory function is called each time the service is resolved, creating a new instance.
Type parameters
| Name | Description |
|---|---|
TService | The service type to register. |
Parameters
| Name | Type | Description |
|---|---|---|
factory | Func | A factory function that creates the service instance. |
contract | string? | An optional contract name for multiple registrations of the same type. |