I have the following method:
private void DoSomething(CoolClass coolClass)
{
if (coolClass == null)
{
throw new ArgumentNullException(\"coolC
Why don't you just write your own version of the method, if you like the simplicity?
public class CustomContract
{
public static void Requires( bool Predicate, string Message )
where TException : Exception, new()
{
if ( !Predicate )
{
Debug.WriteLine( Message );
throw new TException();
}
}
}
Using Code Contracts just to have a friendly API sounds like shooting sparrows with a cannon.