Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="5.14.1" />

 ServiceContext

public struct ServiceContext
Represents the context of a service.
using Stashbox.Registration; using System.Linq.Expressions; using System.Runtime.CompilerServices; namespace Stashbox.Resolution { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public readonly struct ServiceContext { public readonly Expression ServiceExpression; [System.Runtime.CompilerServices.Nullable(2)] public readonly ServiceRegistration ServiceRegistration; internal static readonly ServiceContext Empty; public ServiceContext(Expression serviceExpression, [System.Runtime.CompilerServices.Nullable(2)] ServiceRegistration serviceRegistration) { ServiceExpression = serviceExpression; ServiceRegistration = serviceRegistration; } internal bool IsEmpty() { return Equals(Empty); } private bool Equals(ServiceContext other) { if (ServiceExpression == other.ServiceExpression) return ServiceRegistration == other.ServiceRegistration; return false; } } }