diff --git a/src/Injectio.Attributes/RegisterAttribute.cs b/src/Injectio.Attributes/RegisterAttribute.cs index fa24ed9..6ab3dc8 100644 --- a/src/Injectio.Attributes/RegisterAttribute.cs +++ b/src/Injectio.Attributes/RegisterAttribute.cs @@ -4,6 +4,7 @@ namespace Injectio.Attributes; /// Attribute to indicate the target class should be register for dependency injection /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] +[System.Diagnostics.Conditional("REGISTER_SERVICE_USAGES")] public abstract class RegisterAttribute : Attribute { /// diff --git a/src/Injectio.Attributes/RegisterScopedAttribute.cs b/src/Injectio.Attributes/RegisterScopedAttribute.cs index 5b2125e..308abdf 100644 --- a/src/Injectio.Attributes/RegisterScopedAttribute.cs +++ b/src/Injectio.Attributes/RegisterScopedAttribute.cs @@ -10,6 +10,7 @@ namespace Injectio.Attributes; /// /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] +[System.Diagnostics.Conditional("REGISTER_SERVICE_USAGES")] public class RegisterScopedAttribute : RegisterAttribute { } diff --git a/src/Injectio.Attributes/RegisterServicesAttribute.cs b/src/Injectio.Attributes/RegisterServicesAttribute.cs index 3064fc4..b2367bf 100644 --- a/src/Injectio.Attributes/RegisterServicesAttribute.cs +++ b/src/Injectio.Attributes/RegisterServicesAttribute.cs @@ -14,6 +14,7 @@ namespace Injectio.Attributes; /// /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +[System.Diagnostics.Conditional("REGISTER_SERVICE_USAGES")] public class RegisterServicesAttribute : Attribute { diff --git a/src/Injectio.Attributes/RegisterSingletonAttribute.cs b/src/Injectio.Attributes/RegisterSingletonAttribute.cs index 200875e..4a2ff74 100644 --- a/src/Injectio.Attributes/RegisterSingletonAttribute.cs +++ b/src/Injectio.Attributes/RegisterSingletonAttribute.cs @@ -10,6 +10,7 @@ namespace Injectio.Attributes; /// /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] +[System.Diagnostics.Conditional("REGISTER_SERVICE_USAGES")] public class RegisterSingletonAttribute : RegisterAttribute { } diff --git a/src/Injectio.Attributes/RegisterTransientAttribute.cs b/src/Injectio.Attributes/RegisterTransientAttribute.cs index b0bd407..95de80f 100644 --- a/src/Injectio.Attributes/RegisterTransientAttribute.cs +++ b/src/Injectio.Attributes/RegisterTransientAttribute.cs @@ -21,6 +21,7 @@ namespace Injectio.Attributes; /// /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] +[System.Diagnostics.Conditional("REGISTER_SERVICE_USAGES")] public class RegisterTransientAttribute : RegisterAttribute { }