How to return variable datatypes from a method
<p>I have a method whose callers require different datatypes.  I could repeat the requisite conversions a dozen times by putting them in each of the callers, but it seems much more efficient to do it once in the called method.</p>

<pre><code>public String myMethod(String myArg)
{    
    return DoSomething(myArg);
}

public Int32 myMethod(String myArg)
{
    return Convert.ToInt32(DoSomething(myArg));
}

private String DoSomething(key)
{
    return SomeList[key];
}
</code></pre>

<p>If I have multiple methods that pull data from SomeList and have to utilize different data types then in each I have to do a type conversion.  Examples might be session variables or query or form requests or any other number of things.  </p>

<p>In VB I could say</p>

<pre><code>Function myMethod(myArg as String) as Variant
    myMethod=DoSomething(myArg)
End Function
</code></pre>

<p>Sorry if the original post was not very clear.  I hope this makes more sense.</p>

<p>Thanks</p>
