29 lines
639 B
C#
29 lines
639 B
C#
namespace Connected.Annotations
|
|
{
|
|
public enum ServiceRegistrationMode
|
|
{
|
|
Auto = 1,
|
|
Manual = 2
|
|
}
|
|
|
|
public enum ServiceRegistrationScope
|
|
{
|
|
Singleton = 1,
|
|
Scoped = 2,
|
|
Transient = 3
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
|
public sealed class ServiceRegistrationAttribute : Attribute
|
|
{
|
|
public ServiceRegistrationAttribute(ServiceRegistrationMode mode, ServiceRegistrationScope scope)
|
|
{
|
|
Mode = mode;
|
|
Scope = scope;
|
|
}
|
|
|
|
public ServiceRegistrationMode Mode { get; } = ServiceRegistrationMode.Auto;
|
|
public ServiceRegistrationScope Scope { get; } = ServiceRegistrationScope.Scoped;
|
|
}
|
|
}
|