Class UniqueServiceDescriptor
A custom Microsoft.Extensions.DependencyInjection.ServiceDescriptor that supports unique checking
Inheritance
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 SourceUniqueServiceDescriptor(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 SourceEquals(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. |
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 |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |