title: Accessing properties of TOM.NET objects when passing them between methods after GetItems(filter) call
body: <p>We're facing a strange issue when using the GetItems method and passing each item within the returned collection to another method.</p>
  
  <p>We are on Tridion 2011 GA.</p>
  
  <p>The following the code is breaking:</p>
  
  <pre><code>private void foo(StructureGroup structureGroup, Session session, int counterTemp, int levels)
  {
      OrganizationalItemItemsFilter filtersg= new OrganizationalItemItemsFilter(session);
      filtersg.Recursive = false;
      IEnumerable&lt;ItemType&gt; itemtype = new List&lt;ItemType&gt; { ItemType.StructureGroup};
      filtersg.ItemTypes = itemtype;
  
      foreach (StructureGroup sg in structureGroup.GetItems(filtersg))
      {
          GetSiteMap(sg, counterTemp, levels);
      }
  }
  
  private void GetSiteMap(StructureGroup sg, int counter, int levels)
  {
      logger.Info(sg.Id);  //ok
      logger.Info(sg.Title);  //ok
      logger.Info(sg.Directory);  // null !?
  }
  </code></pre>
  
  <p>However, if the sg.Directory is access prior to passing sg into the next method, all works fine:</p>
  
  <pre><code>private void foo(StructureGroup structureGroup, Session session, int counterTemp, int levels)
      OrganizationalItemItemsFilter filtersg= new OrganizationalItemItemsFilter(session);
      filtersg.Recursive = false;
      IEnumerable&lt;ItemType&gt; itemtype = new List&lt;ItemType&gt; { ItemType.StructureGroup};
      filtersg.ItemTypes = itemtype;
  
      foreach (StructureGroup sg in structureGroup.GetItems(filtersg))
      {
          logger.Info(sg.Directory); //if printed here, all works fine down the line.
          GetSiteMap(sg, counterTemp, levels);
      }
  }
  
  private void GetSiteMap(StructureGroup sg, int counter, int levels)
  {
      logger.Info(sg.Id);  //ok
      logger.Info(sg.Title);  //ok
      logger.Info(sg.Directory);  // ok   }
  }
  </code></pre>
  
  <p>It feels that there is something going on with the GetItems() method where it doesn't return the full object, and once passing the partially loaded object to the next method, it's not able to load the properties as if the original reference is lost.</p>
  
  <p>Can someone please shed some light on what's happening here?  Also, is it bad to pass TOM.NET objects between methods?</p>
  
  <p>Thanks</p>