Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Shouldn't AllowNew, AllowEdit etc. be protected?

$
0
0

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


Viewing all articles
Browse latest Browse all 764

Trending Articles