© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
17 replies
Steak

❔ Wrapping Conditional Attribute

Is There a way to wrap Conditional attribute, so I wouldn't have to declare Conditional Attribute all over?
 [Conditional("RELEASE")]
 [AttributeUsage(AttributeTargets.Method)]
 public class UnExecuteableAttribute : Attribute { }
 [Conditional("RELEASE")]
 [AttributeUsage(AttributeTargets.Method)]
 public class UnExecuteableAttribute : Attribute { }


❌❌❌
[Conditional("CLIENT")]
private void Execute() { }
[Conditional("CLIENT")]
private void Execute() { }


✅✅✅
[UnExecuteable]
private void Execute() { }
[UnExecuteable]
private void Execute() { }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Apply multiple attributes from custom attribute
C#CC# / help
2y ago
Regex conditional
C#CC# / help
3y ago
❔ Conditional data seed
C#CC# / help
4y ago
Attribute Style Preference
C#CC# / help
2y ago