How to use method SetIsReadOnly()

How to use method SetIsReadOnly()

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


simon posted on Monday, March 23, 2009

As the title

 

 

Michael replied on Tuesday, March 24, 2009

I'm not quite sure what you mean, Simon. I don't see a SetIsReadOnly method anywhere in CSLA. Please explain?

Regards
Michael

simon replied on Wednesday, March 25, 2009

ObjectFactory (090222)

http://www.lhotka.net/cslabugs/edit_bug.aspx?id=353

Add a SetIsReadOnly() method to the ObjectFactory base class.

 

the method shown in the change log, but i don't know how to use it.

 

thank you for reply.

RockfordLhotka replied on Wednesday, March 25, 2009

SetIsReadOnly() is in 3.6.2. This method is necessary to create a Fetch() method for a ReadOnlyListBase or NameValueListBase object.

Those objects default to IsReadOnly=true, which means you can't load them with data. So your Fetch() method must set the list to be writable, load the object, then set it to read-only.

This is the same code you'd write in DataPortal_Fetch(), except that IsReadOnly has no public setter, so you need the SetIsReadOnly() helper to alter the property value.

simon replied on Thursday, March 26, 2009

I see.

Thank you and your framework.

Copyright (c) Marimer LLC