Skip to content

KeyedServiceRegistrationAttribute<TService> Constructors

ClassConstructors1 member
Attribute used to define the keyed service registration of a given type
Constructor(object?, ServiceLifetime)Section titled Constructor(object?, ServiceLifetime)
Attribute used to define the keyed service registration of a given type
public sealed class KeyedServiceRegistrationAttribute<TService>
{
public KeyedServiceRegistrationAttribute(
object? key,
ServiceLifetime lifetime)
{
// ...
}
}
keyobject?
lifetimeServiceLifetime
Constructor to specify the key and lifetime