Stashbox by Peter Csajtai

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

 ServiceContext

public struct ServiceContext
Represents the context of a service.
using Stashbox.Registration; using System.Linq.Expressions; using System.Runtime.CompilerServices; namespace Stashbox.Resolution { [NullableContext(1)] [Nullable(0)] public readonly struct ServiceContext { public readonly Expression ServiceExpression; [Nullable(2)] public readonly ServiceRegistration ServiceRegistration; internal static readonly ServiceContext Empty; public ServiceContext(Expression serviceExpression, [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; } } }