title: Returning data from one method to another within a class
body: <p>Thanks for help with the question I just submitted about anonymous classes. Now I understand more. Here's a bit more of an example:</p>
  
  <pre><code>public class abc {
   public xx doAction() {
      return ( new { ID = 5, Name= "Dave" } );
   }
   public void doStart() {
      var a = doAction();
      var b = a.ID;
      var c = a.Name;
   }
  }
  </code></pre>
  
  <p>So am I correct in saying that the most ideal way to do this would be to declare a class XYX and use it like this:</p>
  
  <pre><code>public class abc {
   public XYZ doAction() {
      return ( new XYZ { ID = 5, Name= "Dave" } );
   }
   public void doStart() {
      var a = doAction();
      var b = a.ID;
      var c = a.Name;
   }
  }
  </code></pre>
  
  <p>The class would be only used for this one data transfer between the two methods. </p>