Need help with passing Csla object

Need help with passing Csla object

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


Meltdown posted on Tuesday, February 03, 2009

Being new to Csla.Net, I have a question.  I have an application framework built using WCF services and passing a message object between the services.  Within that message object (DataContract) I would like to include a BusinessListBase object (a collection).  That BusinessListBase object contains BusinessBase objects and two other BusinessListBase objects.  I am getting serialization errors when trying to call the WCF methods. 

In what I have read, that is to be expected since serialization is used internaly to csla.net.  Again, based on what I have read, I think I need to use the DataMapper to map the objects to DTOs (or Dictionary objects) and pass them.  Since I have several layers of csla objects to map, and want to hide that work, can I use the OnSerializing events to create the dictionary objects for each csla object and pass that structure through the message object? 

Is this the proper thing to do?  Has anyone else done anything similar to this?

Thanks

JoOfMetL replied on Tuesday, February 03, 2009

When I call a service using WCF DataContract classes that are different objects CSLA. To build, I do it manually, and using the DataMapper.

Root  ==   DataMapper ==  >  RootContract
    foreach Child in Root.MyBusinessList
        Child ==   DataMapper ==  >  ChildContract
        RootContract.MyDataContratList.add (ChildContract );

Copyright (c) Marimer LLC