dataportal, avoid transporting property

dataportal, avoid transporting property

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


fsl posted on Tuesday, September 21, 2010

Hi there

I have a certain heavyweight property on a BO. Is is possible to avoid sending it with the BO to the dataportal, when doing an update? 

I only need to save the property at the first update or insert of the BO.. It is never changed after that..

Any suggestions?

RockfordLhotka replied on Tuesday, September 21, 2010

Unfortunately there is no easy way to do this. If you are pure .NET you may be able to do this:

  1. implement ISerializable (which isn't real easy)
  2. use a private backing field for this property
  3. in your ISerializable interface you can now control whether the field is serialized

If you are using Silverlight it is a little easier.

  1. use a private backing field for this property
  2. override OnGetState/OnSetState and only serialize this field when you desire

 

Copyright (c) Marimer LLC