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;
public ServiceContext(Expression serviceExpression, [System.Runtime.CompilerServices.Nullable(2)] ServiceRegistration serviceRegistration)
{
ServiceExpression = serviceExpression;
ServiceRegistration = serviceRegistration;
}
internal bool IsEmpty()
{
return Equals(default(ServiceContext));
}
private bool Equals(ServiceContext other)
{
if (ServiceExpression == other.ServiceExpression)
return ServiceRegistration == other.ServiceRegistration;
return false;
}
}
}