How to map values in the db, to my objects when the type is known at runtime?
<p>My database has a table that looks like:</p>

<pre><code>conditionID, conditionType, conditionValue
</code></pre>

<p><code>ConditionType</code> is an enumeration with values like Integer, String, DateTime, etc.</p>

<p>The ConditionValue is stored as a string.</p>

<p>Now I want to encapsulate this row in a class such that I can perform comparison's on the ConditionValue, so this like EqualTo, GreaterThan, LessThan etc.</p>

<p>At the moment my design isn't correct because I have methods like (<code>otherValue</code> is the value I am comparing against):</p>

<pre><code>GreaterThan(string value, string otherValue);
GreaterThan(int value, int otherValue);
GreaterThan(DateTime value, DateTime otherValue);
</code></pre>

<p><strong>Could I somehow make a ConditionValue class that encapsulates this information so I can do:</strong></p>

<pre><code>GreaterThan(IConditionValue condition, IConditionValue otherValue)
</code></pre>
