Read only object in an editable list

Read only object in an editable list

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


dla0819 posted on Thursday, May 29, 2008

I would like to create an editable list of read only objects.  My first attempt was as follows:

<Serializable()> _

Public Class HolidayList

Inherits BusinessListBase(Of HolidayList, HolidayInfo)

 

End Class

Where HolidayInfo is a ReadOnlyBase.  Obviously I can not do this because BusinessListBase expects to receive the BusinessBase (at least this is how I understand it).  So what would be the best way to go about creating a list that I can add and delete objects to the list without the requirement of the objects themselves being editable?

sergeyb replied on Thursday, May 29, 2008

I believe you need to create business base based object (HolidayInfo) with all properties declared as read-only.

 

 

Sergey Barskiy

Senior Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: dla0819 [mailto:cslanet@lhotka.net]
Sent: Thursday, May 29, 2008 4:44 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Read only object in an editable list

 

I would like to create an editable list of read only objects.  My first attempt was as follows:

<Serializable()> _

Public Class HolidayList

Inherits BusinessListBase(Of HolidayList, HolidayInfo)

 

End Class

Where HolidayInfo is a ReadOnlyBase.  Obviously I can not do this because BusinessListBase expects to receive the BusinessBase (at least this is how I understand it).  So what would be the best way to go about creating a list that I can add and delete objects to the list without the requirement of the objects themselves being editable?



Copyright (c) Marimer LLC