Csla DataMapper and Newtonsoft Json serializer

Csla DataMapper and Newtonsoft Json serializer

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

peterbartels posted on Tuesday, October 05, 2010


I have a question about using the Csla mapping method. 

We are developing a medical application. We use many Csla functionalities, which are great!

We want to use the Csla DataMapper because we have a similar structure of business object in the GUI (which is made in javascript).

We use the combination Ext.Direct->Newtonsoft->Csla and all actions from the GUI are received in a controller method:

public ActionResult UpdatePrescription(Prescription p)

Newtonsoft provides a way to directly map a Json string to a business object.

However, the business object is a Csla BusinessBase and can only be created by using the Csla Prescription.NewPrescription while Newtonsoft uses a public constructor to create a new instance. 

Using this, it's not an official Csla object. Also Child object are created using the public constructor and will not be official Csla objects.

Does anyone have a solution for using the DataMapper with Newtonsoft?



Copyright (c) Marimer LLC