mscorlib 4.0.0.0 System.Object Contains methods that allow various contracts to be specified in code.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Diagnostics.Conditional("DEBUG")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` The condition to verify. Trigger a contract failure if condition is false.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("DEBUG")
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` `` The condition to verify. Message to display if condition is false. Trigger a contract failure if condition is false.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("DEBUG")
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` The condition that is assumed to be true. Forces the condition specified to be considered true by the code contract tools. If the code contracts are included at runtime, this acts like a .
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Diagnostics.Conditional("DEBUG")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` `` The condition that is assumed to be true. Message to display if condition is false. Forces the condition specified to be considered true by the code contract tools. If the code contracts are included at runtime, this acts like a .
- Event
  4.0.0.0
  System.EventHandler<System.Diagnostics.Contracts.ContractFailedEventArgs> Called on any contract failure.

  Event handlers can mark the contract failure as having been handling by calling .

  Event handlers can this current contract failure unwind the stack by calling . This causes a to be thrown.

- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void Marker method to mark the end of the legacy requires code block. Legacy requires are preconditions that perform tests and throw exceptions. This is the only form of legacy require allowed. `if (parameter < 0) { throw new ArgumentException(); } Contracts.EndContractBlock();`
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` The postcondition to verify. Specifies a postconditon contract for normal return. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` `` The postcondition to verify. Message to display on contract failure. Specifies a postconditon contract for normal return. ll code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void System.Exception `` The exception type that causes this postcondition to be verified. The postcondition to verify. Specifies a postcondition contract for when an exception is thrown. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void System.Exception `` `` The exception type that causes this postcondition to be verified. The postcondition to verify. Message to display on contract failure. Specifies a postcondition contract for when an exception is thrown. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Boolean `` `` `` The inclusive start of the range. The exclusive end of the range. TThe predicate to apply to each value within the range. Determines that at least one value in the range satisfies the predicate. Whether at least one value in the range satisfies the predicate. This method can be used within a contract condition to allow contracts to be applied to integer ranges.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Boolean `` `` The type of elements in the collection. The collection to check. The predicate to apply to each element of the collection. Determines that at least one element in the collection satisfies the predicate. Whether at least one element in the collection satisfies the predicate. This method can be used within a contract condition to allow contracts to be applied to collections.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Boolean `` `` `` The inclusive start of the range. The exclusive end of the range. The predicate to apply to each value within the range. Determines that all values in the range satisfy the predicate. Whether all values in the range satisfy the predicate. This method can be used within a contract condition to allow contracts to be applied to integer ranges.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Boolean `` `` The type of elements in the collection. The collection to check. The predicate to apply to each element of the collection. Determines that all elements in the collection satisfy the predicate. Whether all elements in the collection satisfy the predicate. This method can be used within a contract condition to allow contracts to be applied to collections.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` The invariant condition to verify. Specifies an invariant class-level condition. Invariant conditions can only be used in a method marked with the attribute. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` `` The invariant condition to verify. Message to display on contract failure. Specifies an invariant class-level condition. Invariant conditions can only be used in a method marked with the attribute. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  T `` The type of the value. The field or parameter of which to represent the initial value. Used within a postcondition to represent an initial value. The initial value. The code contract rewriter tool must be used for this method to be effective. Otherwise the default value for the type is returned.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` The precondition to verify. Specifies a precondition contract for normal return. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Diagnostics.Conditional("CONTRACTS_FULL")
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void `` `` The precondition to verify. Message to display on contract failure. Specifies a precondition contract for normal return. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void System.Exception `` The exception type that causes this precondition to be verified. The precondition to verify. Specifies a precondition contract for when an exception is thrown. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Void System.Exception `` `` The exception type that causes this precondition to be verified. The precondition to verify. Message to display on contract failure. Specifies a precondition contract for when an exception is thrown. All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  T The type of the return value. Used within a postcondition to represent the return value. The return value. The code contract rewriter tool must be used for this method to be effective. Otherwise the default value for the type is returned.
- Method
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  T `` The type of the out parameter. The out parameter. Used within a postcondition to represent the final value of an out parameter. The final value of the out parameter. The code contract rewriter tool must be used for this method to be effective. Otherwise the default value for the type is returned in the out parameter and the return value.