Class ServiceDescriptor
Describes a service with its service type, implementation, and lifetime.
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: Unity.AppUI.MVVM.dll
Syntax
public class ServiceDescriptor
Constructors
ServiceDescriptor(Type, Type, ServiceLifetime)
Creates a new instance of ServiceDescriptor.
Declaration
public ServiceDescriptor(Type serviceType, Type implementationType, ServiceLifetime lifetime)
Parameters
Type | Name | Description |
---|---|---|
Type | serviceType | The service type. |
Type | implementationType | The implementation type. |
ServiceLifetime | lifetime | The lifetime of the service. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Properties
implementationType
Gets the implementation type of the service.
Declaration
public Type implementationType { get; }
Property Value
Type | Description |
---|---|
Type |
lifetime
Gets the lifetime of the service.
Declaration
public ServiceLifetime lifetime { get; }
Property Value
Type | Description |
---|---|
ServiceLifetime |
serviceType
Gets the service type.
Declaration
public Type serviceType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
Singleton(Type, Type)
Creates a new instance of ServiceDescriptor as a singleton.
Declaration
public static ServiceDescriptor Singleton(Type serviceType, Type implementationType)
Parameters
Type | Name | Description |
---|---|---|
Type | serviceType | The service type. |
Type | implementationType | The implementation type. |
Returns
Type | Description |
---|---|
ServiceDescriptor | The service descriptor. |