Postconditions ensure that the returned results from a method will match the provided definition. This provides the caller with a definition of the expected result. Postconditions may allowed for simplied implmentations as some possible outcomes can be provided by the static analyizer.

Example…

string GetValue()
{
    Contract.Ensures(Contract.Result<string>() != null);

    return null;
}

Static Analyis Result…

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9bdbdd52-a008-4873-81bc-2d69b08c75d3/Untitled.png