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

Single Child Object Property

$
0
0

I am using CSLA 3.8.4

I have come to the following conclusion, but wanted to soundboard.

CSLA does not support null property semantics, or the idea of single child object property being optional. For all intents and purposes an instance of the property must always exist (even if the instance creation is deferred). CSLA's internal code requires the existence of an instance in order to work properly for business object metastate management, undo, binding etc.

Is my conclusion correct? Am I missing something?

 

Here is what I need to accomplish.

I have an editable root object that has an editable child property (contact).

It must be exactly one contact, not a list of contacts.

By default the contact is null.

If the user checks a checkbox, an instance is created. (Unchecking returns to null)

Rules run only if an instance exists.

CancelEdit will return the contact to its initial state (not n level undo, just single edit cancellation)

If the contact is null no database record should exist.

 

Can the above be accomplished? As an aside, does CSLA 4.x support provide better support for the single child object properties? 


Viewing all articles
Browse latest Browse all 764

Trending Articles