Class
DefaultServiceCollection
class DefaultServiceCollection
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.dll
Source file: Services.rvn
Inheritance: Object → DefaultServiceCollection
Implements: ServiceCollection
The default collection: single lookups choose the last registration; plural lookups preserve order. Build validates constructor availability without creating services.
Constructors
1 item
DefaultServiceCollection()
The default collection: single lookups choose the last registration; plural lookups preserve order. Build validates constructor availability without creating services.
Methods
13 items
Add(descriptor: ServiceDescriptor) -> Result<void, ServiceError>
Validates and retains an immutable descriptor without activating it.
Implements ServiceCollection.Add
Add(service: TypeInfo, implementation: TypeInfo, lifetime: ServiceLifetime) -> Result<void, ServiceError>
Registers an unkeyed implementation.
Implements ServiceCollection.Add
AddFactory(service: TypeInfo, factory: (ServiceProvider) -> Result<object, ServiceError>, lifetime: ServiceLifetime) -> Result<void, ServiceError>
Registers an unkeyed factory whose result becomes provider-owned.
Implements ServiceCollection.AddFactory
AddInstance(service: TypeInfo, instance: object) -> Result<void, ServiceError>
Registers a caller-owned unkeyed instance.
Implements ServiceCollection.AddInstance
AddKeyed(service: TypeInfo, key: object?, implementation: TypeInfo, lifetime: ServiceLifetime) -> Result<void, ServiceError>
Registers a keyed implementation.
Implements ServiceCollection.AddKeyed
AddKeyedFactory(service: TypeInfo, key: object?, factory: (ServiceProvider, object?) -> Result<object, ServiceError>, lifetime: ServiceLifetime) -> Result<void, ServiceError>
Registers a factory receiving its key; the result becomes provider-owned.
Implements ServiceCollection.AddKeyedFactory
AddKeyedInstance(service: TypeInfo, key: object?, instance: object) -> Result<void, ServiceError>
Registers a caller-owned keyed instance.
Implements ServiceCollection.AddKeyedInstance
Build() -> Result<ServiceProvider, ServiceError>
Creates an independent snapshot, validating public constructors without invoking factories.
Implements ServiceCollection.Build
Equals(other: object?) -> bool
Tests reference identity by default; an ordinary class may override equality.
Inherited from Object.Equals
GetHashCode() -> int
Returns a stable identity hash by default; an ordinary class may override it consistently with equality.
Inherited from Object.GetHashCode
GetType() -> TypeInfo
Returns metadata for the concrete runtime type of this instance.
Inherited from Object.GetType
ToString() -> string
Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override.
Inherited from Object.ToString
TryAdd(descriptor: ServiceDescriptor) -> Result<bool, ServiceError>
Preserves the first matching registration regardless of lifetime or activation source.
Implements ServiceCollection.TryAdd