If the object that violates the rules was assigned to the called constructor, method, or property, then an ArgumentException. If the rule violation object was part of your state from a previous operation, and then a method or property was called that insists on the presence of this attribute, InvalidOperation.
source
share