6
Bir özniteliğin varlığını başka bir öznitelik kodu içinde test etmek mümkün mü? MyTestAttribute.IsValid RequiredAttribute Inception.Levels olup olmadığını belirlemek mümkün olduğunu ...Diğer Özniteliklerin Kodundan Öznitelikleri Test Etme
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
}
}
:
Eğer aşağıdaki sınıf tanımı var ki?
Ooooh! İyi bir! Sanırım hayır, ama bu sadece bir tahmin. – zmbq