Shouldn't AllowNew, AllowEdit etc. be protected?

Shouldn't AllowNew, AllowEdit etc. be protected?

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


swegele posted on Sunday, February 23, 2014

In fact in Rocky's CSLA 4 DataAccess book on page 120 he says this:

If you want to disable the AddNew behavior you should set the AllowNew property to false. For example:
public SkillEditList() { AllowNew = false; }
If this protected property is false, calling the AddNew method will result in an exception being thrown.

but when I look in the CSLA source of BusinessListBase I see these methods are Public.  And indeed I can change them from outside my BusinessList object.  So what is the point of setting the value if the consumer can just unset it?  This doesn't make sense.

Am I missing something?

Thanks,

Sean

RockfordLhotka replied on Tuesday, February 25, 2014

That sounds like a bug to be sure, thanks for pointing that out.

RockfordLhotka replied on Tuesday, February 25, 2014

https://github.com/MarimerLLC/csla/issues/259

Copyright (c) Marimer LLC