Which one should I use? DataPortal.Execute<T>(), or DataPortal.Execute()

Which one should I use? DataPortal.Execute<T>(), or DataPortal.Execute()

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


fudongma posted on Friday, March 06, 2009

I created a cusom CommandBase class:

[Serializable()]
public class MailManager : Csla.CommandBase

For the Factory Methods, which one should I use?
       MailManager cmd = new MailManager();
       cmd = DataPortal.Execute<MailManager>(cmd);

OR  cmd = DataPortal.Execute(cmd);

Please help.

 

RockfordLhotka replied on Friday, March 06, 2009

Either one is fine, but I tend to use the generic overload so I don't have to manually cast the result.

Copyright (c) Marimer LLC