ObjectFactory.LoadProperty() for CommandBase

ObjectFactory.LoadProperty() for CommandBase

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


Peran posted on Thursday, January 27, 2011

Hi Rocky,

 

Have you considered adding IManageProperties to CommandBase thus allowing the ObjectFactory to load a property with a private setter?

It would be a 'nice to have' allowing my results property to have a private setter. 

The implementation would be similar to ReadOnlyBase.

 

Regards

 

Peran

RockfordLhotka replied on Thursday, January 27, 2011

That is a good idea, do you want to add an entry to the wish list for this?

Peran replied on Friday, January 28, 2011

Added an enhancement as issue 890.

 

Peran

agartee replied on Monday, October 17, 2011

I see the suggestion still has "no priority".  Is there a work-around for this?  How can I use an "Exists" command with the ObjectFactory if I can't populate the result property?

StefanCop replied on Monday, October 17, 2011

Workarounds:

a) Use ReadOnlyBase as base class (like unit-of-work)

b) Use normal C# properties (of serializable content; public if using SL)

agartee replied on Tuesday, October 18, 2011

I really didn't like the idea of having the result property publicly settable.  A ReadOnlyBase UoW-like implementation seems like a much better idea.  I had apparently overlooked that sample in Rocky's book and was focused on the CommandBase UoW examples (and getting wrapped up with calling Execute() for all command-like behaviors).  Thanks for the quick response!

Copyright (c) Marimer LLC