Add properties to BusinessList?

Add properties to BusinessList?

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


alex.enjoy posted on Tuesday, November 27, 2012

Hello,

is it okay to add standard CSLA properties to a BusinessList object?
I have defined the following classes:

ContactEdit : BusinessBase<ContactEdit> (Root Editable Object)
ConnectionList : BusinessListBase<ConnectionList, ConnectionEdit> (Editable Child List)
ConnectionEdit : BusinessBase<ConnectionEdit> (Editable Child)

Basically, the contact contains a collection of connections.
Now I want to declare one of these connections as primary connection.
My intension is to add a property to the ConnectionList as following:
public PropertyInfo<ConnectionEdit> PrimaryConnectionProperty;

Is this a valid approach? Is there a better approach to archieve this goal?

Thanks, alex.

alex.enjoy replied on Tuesday, November 27, 2012

Okay, found it for myself within the Csla books.

For everyone reading this, you have to add an intermediate class containing both the List and the default item like this:

ContactEdit : BusinessBase<ContactEdit> (Root Editable Object)
ContactConnectionsEdit : BusinessBase<ContactConnectionsEdit> (Editable Child, containing the default property and the List property.)
ConnectionList : BusinessListBase<ConnectionList, ConnectionEdit> (Editable Child List)
ConnectionEdit : BusinessBase<ConnectionEdit> (Editable Child)

alex.

Copyright (c) Marimer LLC