How do you get info back from Command object?

How do you get info back from Command object?

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


dtabako posted on Wednesday, May 21, 2008

The way I can think of is to create a return object that contains properties for all the info you want to return (such as Result, Message, etc.). Then have the Execute() method return that object. Is that the way it's supposed to be done? Is there a better way? I have read on these forums that one of the reasons for using a Command object is so that you can get some info back. So I assume there is a generally accepted way of doing that. I'm sure I could get it working with my return object but I want to make sure I'm following "best practices" as much as possible.

Thanks,

Dennis

KennyKen replied on Wednesday, May 21, 2008

Typically we use properties of the command object itself.  The object's serializable.

dtabako replied on Thursday, May 22, 2008

So then you would create a Command object that you can instantiate, rather than a static one?

Copyright (c) Marimer LLC