Is Csla.Data.DataMapper.Map recursive?

Is Csla.Data.DataMapper.Map recursive?

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


k2so posted on Friday, December 12, 2008

ie. Calling a Csla.Data.DataMapper.Map(parent, result);

should also map all the children's publich properties to the result as well?

Looking at ProjectTracker, this seems the case, but just want to make sure, can some1 confirm on this?

Thanks.

RockfordLhotka replied on Saturday, December 13, 2008

No, it is absolutely not recursive. The Map() method maps properties/fields from one object to another - without processing any child or other objects.

vbbeta replied on Tuesday, January 11, 2011

Hi i just saw this thread i would like to check if the cska DataMapper is  not recursive how is the way to get done the Parent/ Child collection VIA data mapper any help

RockfordLhotka replied on Tuesday, January 11, 2011

You just loop through each object in the graph and apply DataMapper to each object individually. Normally this is how you get the data from ASP.NET anyway, so it is a pretty natural process.

vbbeta replied on Wednesday, January 12, 2011

Thanks rocky for the reply

 

i actually at the did that i wrote

For Each row As DataRow in Transaction Table

Dim ItemMapper as New Csla.Data.ObjectAdapter

ItemMapper.Fill(transaction.Item(row("Id")).Items

Next

GridContro.DataSource= TransactionTable

----------

But discovered 

That the GridView is giving me all the items from the derived class EG IsNew, IsFalse . and not just the BusinessObjects

Any idea how to work around this that it should not get that objects

RockfordLhotka replied on Wednesday, January 12, 2011

CSLA uses the Microsoft-defined attribute (Browsable(false)) to indicate which fields should be ignored by data binding. Unfortunately not all Microsoft data binding technologies honor that attribute. If that attribute isn't honored, you need to tell the datagrid control to stop auto-generating the columns and you need to define the columns yourself. That is typically done by using the column editor available from the Columns property in the control's properties window.

Copyright (c) Marimer LLC