BusinessBase inside Command is not passed back to the client

BusinessBase inside Command is not passed back to the client

Old forum URL: forums.lhotka.net/forums/t/6652.aspx


alexsychev posted on Monday, March 23, 2009

Hi,
I have the following command:

  [Serializable]
   public class SaleTransactionRecallCommand : CommandBase
   {   
      private readonly int m_saleTransactionNo;

      private BusinessBase m_tran;

      #region Factory Methods

      public static BusinessBase RecallTransaction(int transactionNo)
      {
         var cmd = new SaleTransactionRecallCommand(transactionNo);
         DataPortal.Execute(cmd);

         return cmd.m_tran;
      }

      #endregion

      ...

   }



DataPortal_Execute instantiates m_tran field as  one of the classes derived from BusinessBase<T>. However , after object is passed back to the client , m_tran remains null.
What is the problem here?

ajj3085 replied on Monday, March 23, 2009

You need to do cmd = DataPortal.Execute( cmd );

alexsychev replied on Monday, March 23, 2009

Oh, that's right. Thanks.

Copyright (c) Marimer LLC