Have property not affect isvalid

Have property not affect isvalid

Old forum URL: forums.lhotka.net/forums/t/12094.aspx


pearljam posted on Friday, July 26, 2013

Is there a way to set a property, but tell it that it has no effect on the validity of the object? In my case I have a base class that sets up some rules (one being for an elevation property). Several classes derive from it. In one class I don't want the result of the elevation rules to cause the object to become invalid.

JonnyBee replied on Friday, July 26, 2013

A couple of options:

  1. Override IsValid method in your BO to exclude this property from the BrokenRules check (field will still have broken rule tho)
  2. Rewrite your rule to check for som condition / other field as to whether it is active or not. 

Copyright (c) Marimer LLC