title: How to return multiple data types from a C# method?
body: <p>I have a method that needs to return different data types based on a search. I'm considering two approaches, since I'm new to C# I don't know which is best, so please help me make my mind.</p>
  
  <p>the first approach is to overload the method like this:</p>
  
  <pre><code>public int Get(string name){
     //...
     return intValue;
  }
  
  public double Get(string name){
     //...
     return doubleValue;
  }
  
  public string Get(string name){
     //...
     return stringValue;
  }
  </code></pre>
  
  <p>the second approach is to have different methods for each data type like this:</p>
  
  <pre><code>public int GetInt(string name){
     //...
     return intValue;
  }
  
  public double GetDouble(string name){
     //...
     return doubleValue;
  }
  
  public string GetString(string name){
     //...
     return stringValue;
  }
  </code></pre>
  
  <p>which one is the safest for C# considering this code will be published from a DLL?</p>