Serialising a class that inherits from a CSLA object

Serialising a class that inherits from a CSLA object

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


cjmorris1 posted on Tuesday, April 16, 2013

When I try to serialise the following class, it only contains BasketItem and nothing from Basket.

BusinessListBase is a CSLA class.

Can you tell me why?

public class Basket : BusinessListBase<Basket, BasketItem>

{

}

So I get all the properties of a BasketItem but nothing from Basket.

JonnyBee replied on Tuesday, April 16, 2013

CSLA does not support properties on a list. 

If you need business properties on a list you should create

Basket (BusinessBase)

    BasketItemList (BusinessListBase)

          BasketItem. (BusinessBase)

cjmorris1 replied on Tuesday, April 16, 2013

Basket is what I want and this is not a list.

JonnyBee replied on Wednesday, April 17, 2013

Hi,

The point is this:

public class Basket : BusinessListBase<Basket, BasketItem>

Your Basket class is a list class - you must change your structure so that Basket is a BusinessBase with properties and create a new list class to hold BasketItems.

 

 

skagen00 replied on Wednesday, April 17, 2013

What Jonny is suggesting is change:

Basket (BLB) containing BasketItem (BB) to:

Basket (BB), with whatever additional properties you want, including a property of BasketItemList (BLB) containing BasketItem (BB)

Copyright (c) Marimer LLC