Parameter validation using Contract
Parameters can be validated by using the Contract class.
Example:
private void Foo(object p_obj) {System.Diagnostics.Contracts.Contract.Requires<ArgumentNullException>(p_objSystem.Diagnostics.Contracts.Contract.Requires<ArgumentNullException>(p_obj != null, "Object parameter cannot be null"); }