Hi,
we need to add a field to an entity at run time,
the reasone is that we need to bind this entity to a grid and we need to display this
extra column which is a summery of data that is available at runtime.
what we did is inherrite the entity we want to add the field to,
added the property and added the field to the Fields collection.
we can build and populate the entity, pass it to the client and bind it to the grid.
when we try to save the updated entity, we get the following exception:
The element '<The name of the new field>' isn't found as a property of entity
'<the name of the base entity>'
it seems that the serialization code recognizes the entity to be serialized as the base entity and not the drived class.
when debugging, i see that the type of the entity being sent is the right one.
i have traced the wcf message's body content and here it is:
<UnrecognuzedDeposits z:Type="Project.Namespace.UnrecognuzedDeposits" z:Assembly="Project.Namespace, Version=2.0.16.2, Culture=neutral, PublicKeyToken=null" xmlns="http://schemas.datacontract.org/2004/07/Project.Namespace" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
- <HfkdInputTransactStorageEntity ObjectID="c69c269f-2bfd-47b7-97a1-e385524dbf6a" Format="Compact25">
<TransactionId>22816773</TransactionId>
<AdmissionDate>2009-09-04T00:00:00</AdmissionDate>
<TransactionSource>2</TransactionSource>
<SumToSplit>500</SumToSplit>
<_lps fs="FRUVFEBVABUAAAAAAEEBAAUABFBA" es="0" />
</HfkdInputTransactStorageEntity>
</UnrecognuzedDeposits>
UnrecognuzedDeposits is the drived class.
HfkdInputTransactStorageEntity is the base entity.
SumToSplit is the field we add to the base class.
can you help me?