How Can I Structure My Code So I Don't Hard Code Values?
<p>I have a function that does a data lookup and returns a value:</p>

<pre><code>public int LastBalance(int meterNumber)
{
    // Return value from data access layer
    return dal.GetLastBalance(meterNumber);
}
</code></pre>

<p>For a specific meterNumber value I want to return 0 (zero).</p>

<p>Is this OK?</p>

<pre><code>public int LastBalance(int meterNumber)
{
    if(meterNumber = 999)
    {
        return 0;
    }
    else
    {
        // Return value from data access layer
        return dal.GetLastBalance(meterNumber);
    }
 }
</code></pre>

<p>Is there a way I can do this without hardcoding a value (999 in this case)? What if in the future I have other "magic numbers" that I need to return specific values for?</p>
