ServiceRegistrationAttribute Class
Definition
Attribute used to define the service registration of a given type
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]public class ServiceRegistrationAttribute : AttributeInheritance object → Attribute
Remarks
Constructor to specify the service type including optional runtime
Constructors
ServiceRegistrationAttribute(ServiceLifetime, params Type[])
Attribute used to define the service registration of a given type
public ServiceRegistrationAttribute(ServiceLifetime lifetime, params Type[] serviceTypes)Parameters
lifetime ServiceLifetime
serviceTypes Type[]
Remarks
Constructor to specify the service type including optional runtime
ServiceRegistrationAttribute(params Type[])
Constructor to specify the service type including optional runtime
public ServiceRegistrationAttribute(params Type[] serviceTypes)Parameters
serviceTypes Type[]
Remarks
The default lifetime is Singleton
Properties
ServiceTypes
The service type
public ImmutableArray<Type> ServiceTypes { get; }Lifetime
The lifetime
public ServiceLifetime Lifetime { get; }
