If you mean that the passed method should check itself whether e.g. the parameter is not null, no you cannot do this. Contracts still simply add code to the method body.
What you can however do is wrap the delegate into a different delegate, e.g.:
public T Example<T, TResult>(Func<T, TResult> f)
where T : class
where TResult : class
{
Contract.Requires(f != null);
f = WrapWithContracts(f);
// ...
}
private Func<T, TResult> WrapWithContracts<T, TResult>(Func<T, TResult> f)
where T : class
where TResult : class
{
return p =>
{
Contract.Requires(p != null);
Contract.Ensures(Contract.Result<TResult>() != null);
var result = f(p);
return result;
};
}
This way you can introduce code contracts yourself.