forbid compilation if property of an object is "bigger" than another in c#
<p>I basically don't want to allow compilation if someone makes a specific property of an object bigger than another property of that same object. can I do that? Kind of like:</p>

<pre><code>class Class1 {
    public int property1 { set; get; }
    public int property2 { set; get; }

    public void method (Class1 obj) {
        if (obj.property1 &lt; obj.property2) {
            //won't compile!
        }
    }
}

class Class2 {
    static void Main() {
        Class1 obj = new Class1();
        obj.property1 = 10;
        obj.property2 = 11;
        obj.method(obj);
    }
}
</code></pre>
