I would like to extend the Aurelius entities with additional properties which are not fields in the database, but which can be retrieved when a call for the entity occurs.
Is there an attribute to add to the property to make it behave as a "readonly field" Which is pulled back with the database fields when .Find is called?
These fields are all returned because they are properties of the Aurelius Entity. AND they are database fields.
Is it possible to extend this JSON to include other properties which are generated dynamically by Aurelius, but which are not fields in the database. These would be ReadOnly fields, so they would not form any part of the update process of the record. I am assuming it would be possible to add properties and give them attributes to include them in the entities.
There are many ways to do this implementing your own xdata services, but I think you want to benefit from the automatic Aurelius CRUD endpoints & filtering facilities.
So you may use a [Transient] field linked to an [XDataProperty] property, or just the property managed by a getter/setter.
It's Ok if your client uses pure JSON. If your client will also use Aurelius entities definitions, you'll need to implement some IFDEFs to detect if you're "in" the client or in the xdata server application, so you could bypass the getter/setter when compiling the client.
The JSON that is returned does not include the "Title" field, which is the effect I am trying to achieve.
Is there any way to achieve this, to add a read only computed or lookup property to the values returned in the Aurelius Entity so its value is returned in a call to return the entity?
--
Wagner Replied:
Have you added unit XData.Model.Attributes to your unit, so the attribute is effectively used?
It would be better if you please continue the discussion in the Support Center topic.
--
AH: I had not known I needed to add that unit.
Adding XData.Model.Attributes to my uses clause has returned the values!