title: Which IsValid method should I override when implementing custom ValidationAttribute
body: <p>When I implement a custom attribute inherited from ValidationAttribute class, I've always overrided <code>bool IsValid(object value)</code> method disgarding the other one whose prototype is <code>ValidationResult IsValid(objet value, ValidationContext validationContext)</code>. </p>
  
  <p>Maybe, I should override the second method instead even if I don't use validation context or the result (I use validation with EntityFramework and <code>ModelState.IsValid</code> controller property). Or continue to disregard the overloaded method. If then, could I have an object valid or invalid depending on the context the attribute validation is invoked? Is a situation as shown in the code bellow problematic?</p>
  
  <pre><code>class StrictlyPreviousAttribute : ValidationAttribute
  {
      public override bool IsValid(object value)
      {
          var dateTime = value as DateTime?;
          return dateTime == null || dateTime &lt;= DateTime.Today;
      }
  }
  
  class PreviousAttribute : StrictlyPreviousAttribute 
  {
      public override ValidationResult IsValid(object value, ValidationContext validationContext)
      {
          var dateTime = value as DateTime?;
  
          if(dateTime == DateTime.Today)
          {
              return ValidationResult.Success;
          }
          else
          {
              return base.IsValid(object);
          }
      }
  }
  </code></pre>
  
  <p>I don't know if there is there object misconception or if I'm missing some point. Is there a method I should preferably override instead of the other. Should I override both.</p>