別の属性のコード内の属性の存在をテストすることは可能ですか?
次のクラス定義があるとします。
public class Inception {
[Required]
[MyTest]
public int Levels { get; set; }
}
public class MyTestAttribute : ValidationAttribute {
public override bool IsValid(object o){
// return whether the property on which this attribute
// is applied also has the RequiredAttribute
}
}
... MyTestAttribute.IsValid が Inception.Levels に RequiredAttribute があるかどうかを判断することは可能ですか?