Table of Contents

TXDataModel.IdToKeyPredicate Method

Overloads

TXDataModel.IdToKeyPredicate(TXDataEntityType, TValue)

Returns the key predicate for an entity of the specified class, given a specified value

Remarks

This function returns a string containing the key predicate of a class given the specified id. The key predicate is a string representation of the object id, to be used in an Url to identify a web resource relate to the object. For example, in the url [http://localhost/Customers('ABC'](http://localhost/Customers('ABC')), the key predicate is 'ABC' (with the quotes). If the class has multiple keys (composite key), TValue must be an array of TValue elements with the same number of elements as the entity key properties

Syntax

Unit: XData.Model.Classes

function TXDataModel.IdToKeyPredicate(AType: TXDataEntityType; const Id: TValue): string; overload;

Parameters

<-> Parameter Type Description
AType TXDataEntityType
const Id TValue

See also

TXDataModel.IdToKeyPredicate(TValue, TXDataEntityType, TXDataGetPropValueProc, TXDataGetNavPropValueProc)

Returns the key predicate of an object instance, to be used in Url.

Remarks

This function returns a string containing the key predicate of an object instance. The key predicate is a string representation of the object id, to be used in an Url to identify a web resource relate to the object. For example, in the url [http://localhost/Customers('ABC'](http://localhost/Customers('ABC')), the key predicate is 'ABC' (with the quotes).

Syntax

Unit: XData.Model.Classes

function TXDataModel.IdToKeyPredicate(const Entity: TValue; AType: TXDataEntityType; GetPropValue: TXDataGetPropValueProc; GetNavPropValue: TXDataGetNavPropValueProc): string; overload;

Parameters

<-> Parameter Type Description
const Entity TValue The object instance for which the key predicate will be generated
AType TXDataEntityType The entity type associated with the object. Just for optimization purposes
GetPropValue TXDataGetProp​Value​Proc Reference to a procedure that will read the value of a property
GetNavPropValue TXDataGetNav​Prop​Value​Proc Reference to a procedure that will read the value of a navigation property

Returns

The key predicate of the object

See also