ServiceRegistrationInfo
NexusLabs.Needlr¶
NexusLabs.Needlr¶
ServiceRegistrationInfo Struct¶
public readonly record struct ServiceRegistrationInfo : System.IEquatable<NexusLabs.Needlr.ServiceRegistrationInfo>
Implements System.IEquatable<ServiceRegistrationInfo>
Properties¶
ServiceRegistrationInfo.HasFactory Property¶
Indicates whether the registration was configured with a factory delegate (Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationFactory). When true, ImplementationType will be null.
Property Value¶
ServiceRegistrationInfo.HasInstance Property¶
Indicates whether the registration was configured with a pre-constructed instance (Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationInstance). When true, ImplementationType will typically be null (unless metadata reflects the instance's type indirectly).
Property Value¶
ServiceRegistrationInfo.ImplementationType Property¶
Gets the concrete implementation System.Type, if the registration was made with an implementation type. Returns null when: - The registration uses an Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationFactory. - The registration supplies a pre-built Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationInstance. - The registration represents an open generic without a concrete close (rare in reflection scenarios).
Property Value¶
ServiceRegistrationInfo.Lifetime Property¶
Gets the lifetime (Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton, Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped, or Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient) associated with the registration.
Property Value¶
Microsoft.Extensions.DependencyInjection.ServiceLifetime
ServiceRegistrationInfo.ServiceType Property¶
Gets the service (abstraction/contract) System.Type that was registered. This is the key used by the DI container for resolution requests.
Property Value¶
Methods¶
ServiceRegistrationInfo.ToDetailedString() Method¶
Returns a detailed, formatted string representation of this registration suitable for debugging and diagnostics.
Returns¶
System.String
A multi-line formatted string with registration details.