Validating Inherited Attributes

Topics: Developer Forum
Dec 11, 2009 at 8:38 PM

I ran in to a problem when trying to validate some classes.  I have two models, one that inherits from the other:

public class foo
     [ComparePropertyRule("MinPrice", CompareOperator.LessThan)]
 public virtual decimal Price { get; set; } public virtual decimal MinPrice { get; set; } //Other attributes } public class bar : foo { //Other attributes }

When I try to validate bar objects, ValidationFramework can't find bar's MinPrice property even though it is present in all instances of bar.  If I override MinPrice in bar, the validation functions correctly.

Is this behavior inherent to C# reflection, or is this a bug in ComparePropertyRule?