[ROOT] / doc / toc / ARCQuery / Class / NewKey

AddParser , FunctionKeys , Parsers , QuantileKey , ToString , TryGetP , TryGetPInternal , TryParse , TryParseSingleWord


A function creating new keys (new fields) that can be used against all object types in AgoRapide (against all entities).

Compares roughly to the concept of Extension methods in C#.
TODO: Possible rename into ExtensionKey (???)

This is an expandable concept, that is, you can create your own implementations of this class in your ApplicationSpecificCode.

Note that more usually than not, you should create a new EntityMethodKey (valid for a single entity type) instead of a new NewKey (valid for all object types).

In other words, there is no point in creating new implementations of NewKey when you can instead just create a TryGet{Key}-method directly in your class which gets picked up by EntityMethodKey.
Practical example: If you have a class Customer with FirstName and LastName, do not create NewKeyName, create instead Customer.TryGetName.

There are very few implementing class in StandardAgoRapideCode:
NewKeyCountP (returns the number of properties for a given entity object),
NewKeyCountPRec (returns the number of properties for a given entity object, operates recursively),
NewKeyToPropertyStream (returns the PropertyStream for the given object),
NewKeyGetType (returns the internal C# object type of the given object)

TODO: Add a PK field, describing the value that is returned.

Note that will only come into play when explicit referenced, like 'SELECT *, CountP' for calling NewKeyCountP.


AddParserAdds an ApplicationSpecificCode parser.
FunctionKeysAll FunctionKeys chained at end of compound key (but before an eventual QuantileKey).
ParsersInstances of all the relevant sub classes of NewKey.
QuantileKeyEventual final QuantileKey at end of compound key.
ToStringThe ToString representation is the one relevant when used as key, like in IK or when selecting like 'SELECT {fieldName}'.
TryGetPThe outwards facing executor, understanding use of FunctionKeys.
TryGetPInternalThe internal executor, containing the specific functionality for how to evaluate the key.
TryParseFind parsers from Parsers based on first word in query.
TryParseSingleWordRecommended parser to use for functions without parameters.

Details

Generated 2024-12-22 06:12:09.363 UTC