If you are trying to just calm the analysis mechanism, the easiest thing to use is [NotNull] before declaring the method. The contract annotations you linked to above are a more powerful mechanism for defining the relationship between the input parameters and the return value, for example, [ContactAnnotation("null => null")] .
However, explicit analysis for the Contract.Ensures operator is a completely different proposition, because you cannot define automatic analysis for this operator through [ContractAnnotation] or any other ReSharper annotation attribute.
source share