Given this class class Foo { // Want to find _bar with reflection [SomeAttribute] private string _bar; public string BigBar { get { return this._bar; } } } I...
  • May 21, 2022
  • 0 Comments
I would like to know if it is possible to get attributes of the enum values and not of the enum itself? For example, suppose I have the following...
  • May 2, 2022
  • 0 Comments
This causes a compile-time exception: public sealed class ValidatesAttribute<T> : Attribute { } [Validates<string>] public static class StringValidation { } I realize C# does not support generic attributes. However,...
  • May 2, 2022
  • 0 Comments
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by...
  • April 21, 2022
  • 0 Comments