XData Service and Transient fields

Hi,

How you can declare a transient field or property to an Entity class and pass the object as a parameter to a service operation ?
I had tried to put under the [XDataProperty] with [Transient] attribute with no success.
I had read on xdata manual that "Any transient field or property will not be serialized" but also "You can
now include other (transient) properties or fields in JSON by using XDataProperty attribute." thats why I had tried.

Thank you,

Can you please provide more details, maybe the mapping you have and what exactly is not working? It should work.

Hi Wagner,
I had declare the below class with a FDelLines: TList<TItemDocumentLine> as deleted lines and I   had add [transient,XdataProperty] property. 

In Client side each time I delete a member of FItemDocument_ItemDocLineList: TList<TItemDocumentLine> 
at the same and before deletion I add the deleted object to the FDelLines: TList<TItemDocumentLine>.

After this at the service call I pass the single entity TItemDocument as a parameter and I expected to find the deleted lines on the server.  Note that the deleted lines are available on the client side but not in the server, it is just empty.
Thank you  
 
  [Entity]
  [Table('ItemDocument')]
  [Sequence('IdentityOrSequence')]
  [Id('FID', TIdGenerator.IdentityOrSequence)]
  TItemDocument = class
  private
    [Column('ID', [TColumnProp.Required])]
    FID: Integer;
    [Transient, XdataProperty]
   
    [XDataProperty,Transient]  
    FDelLines: TList<TItemDocumentLine>;
   
    [ManyValuedAssociation([], [TCascadeType.SaveUpdate, TCascadeType.Merge, TCascadeType.RemoveOrphan], 'FItemDocumentID')]
    FItemDocument_ItemDocLineList: TList<TItemDocumentLine>;

    function GetDelLines:TList<TItemDocumentLine>;
    procedure SetDelLines(const Value: TList<TItemDocumentLine>);
 

Have you added XData.Model.Attributes unit to your uses clause? Aren't you receiving a "custom attribute" warning, meaning XDataProperty attribute is being ignored?

It works fine here.

Yes this was the solution, the missing unit 'Xdata.model.Attributes',and yes there was a warning somewhere between other warnings msgs which I was not pay attention at all.
By the way this unit it is a requirement only in the unit class or in every unit which use the class?
Thank you Wagner for your valuable help.

It's required only when you use the [XDataProperty] attribute, i.e., in this case, only in the unit where you declare the entity class.