docs.unity3d.com
    Show / Hide Table of Contents

    Class ServiceDescriptor

    Describes a service with its service type, implementation, and lifetime.

    Inheritance
    Object
    ServiceDescriptor
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.MVVM
    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 serviceType or implementationType is null.

    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023