title: How to override ToString() Method to get data Member of Object
body: <p>I have a method that returns an object. If I return an object then it will give a fully qualified name of the class. But I want to return the data members of the object.</p>
  
  <pre><code>public GetDetails GetInfo()
  {
      GetDetails detail = new GetDetails("john", 47);
      return detail;
  }
  
  public override string ToString()
  {
      return this.Name + "|" + this.Age;
  }
  </code></pre>
  
  <p>I override the <code>ToString()</code> method to get the data member of <code>detail</code> object. But it is not working. How can I achieve that?</p>