Skip to content

IServiceLifetimeSelector Interface

Definition

The Compiled Lifetime Selector

C#
public interface IServiceLifetimeSelector : IServiceTypeSelector

Methods

WithSingletonLifetime()

Registers each matching concrete type with Singleton lifetime.

C#
void WithSingletonLifetime()

WithScopedLifetime()

Registers each matching concrete type with Scoped lifetime.

C#
void WithScopedLifetime()

WithTransientLifetime()

Registers each matching concrete type with Transient lifetime.

C#
void WithTransientLifetime()

WithLifetime(ServiceLifetime)

Registers each matching concrete type with the specified lifetime.

C#
void WithLifetime(ServiceLifetime lifetime)

Parameters

lifetime ServiceLifetime