Am I implementing this simple contract incorrectly?
问题 This is my code: public class RegularPolygon { public int VertexCount; public double SideLength; public RegularPolygon(int vertexCount, double sideLength) { Contract.Requires(vertexCount >= 3); VertexCount = vertexCount; SideLength = sideLength; } [ContractInvariantMethod] private void RegularPolygonInvariants() { Contract.Invariant(VertexCount>=3); } } I have tried with both the Contract.Requires and Contract.Invariant methods to prevent the vertexCount variable from becoming less than or