views:

11

answers:

0

Has anyone seen this exception before? Google or Bing has absolutely very few results.

IsValid(object value) has not been implemented by this class.  
The preferred entry point is GetValidationResult() and classes should override 
IsValid(object value, ValidationContext context).

Here's the custom validator:

public class PriceAttribute : ValidationAttribute
    {
        public string Id { get; set; }

        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            //I think this definition for IsValid is in DataAnnotations 4.0
            return base.IsValid(value, validationContext);
        }

        public override bool IsValid(object value)
        {
            //This I think is the older definition. Not sure why it expects this
            return base.IsValid(value);
        }

    }

Thanks!