Search Results for

    Show / Hide Table of Contents
    View Source

    Class UniqueServiceDescriptor

    A custom Microsoft.Extensions.DependencyInjection.ServiceDescriptor that supports unique checking

    Inheritance
    object
    ServiceDescriptor
    Namespace: Umbraco.Cms.Core.DependencyInjection
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class UniqueServiceDescriptor : ServiceDescriptor
    Remarks

    This is required because the default implementation doesn't implement Equals or GetHashCode. see: https://github.com/dotnet/runtime/issues/47262

    Constructors

    View Source

    UniqueServiceDescriptor(Type, Type, ServiceLifetime)

    Initializes a new instance of the UniqueServiceDescriptor class.

    Declaration
    public UniqueServiceDescriptor(Type serviceType, Type implementationType, ServiceLifetime lifetime)
    Parameters
    Type Name Description
    Type serviceType
    Type implementationType
    ServiceLifetime lifetime

    Methods

    View Source

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    View Source

    Equals(UniqueServiceDescriptor?)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(UniqueServiceDescriptor? other)
    Parameters
    Type Name Description
    UniqueServiceDescriptor other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    View Source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX