Root / Assembly / ARCQuery / Class / FunctionKey

ClassAttribute

FunctionKey

KeyValue
_MemberAddParser, Boolean TryGetP(ARCCore.IP, ARCCore.IP ByRef, System.String ByRef), Boolean TryGetP[T](ARCCore.IP, System.Func`2[System.String,System.ValueTuple`3[System.Boolean,T,System.String]], System.Func`2[T,ARCCore.IP], ARCCore.IP ByRef, System.String ByRef), Parsers, TryParse, TryParseSingleWord
AssemblyNameARCQuery
ClassTypeARCQuery.FunctionKey
DescriptionExtracts data from an already existing value like extracting Year from a DateTime in 'Created.Year()'.

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

Often the extraction is actually a simplification of the existing value, like Created.Year() which would for '2020-06-11 13:36' return '2020'.

Implementing classes in StandardAgoRapideCode:
FunctionKeyDayOfWeek
FunctionKeyMonth
FunctionKeyQuarter
FunctionKeyYear
FunctionKeyYearMonth
FunctionKeyYearQuarter

TODO: As of Jun 2020 this concept only works as last item in a CompoundKey. TODO: This means that you can not chain functions.
TODO: (but there is nothing inherently against doing this, it is just that the parsers are not sufficient advanced yet).

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

It can also be said to work as a function against a value field, but with the syntax 'value.functionName()' instead of functionName(value) (the chosen syntax is not really important, but it has one real advantage, eliminating the need for using aliases to specify what the function result should be called).

(See also ValueComparer which can evaluate expressions like 'WHERE Created = ThisYear')

TODO: Conceptual difference between ValueComparer and FunctionKey (working from two different directions).
TODO: FunctionKey is necessary if you want to pivot around the value.
TODO: ValueComparer is more practical if the value can have different interpretations at the same time.
TODO: An example is ValueComparerDateTime which understands that Created can be all of TODO: ThisYear, ThisMonth, ThisWeek, InTheMorning, ThisMorning and so on.
TOOD: (It would be time consuming to write all the necessary FunctionKey implementations in order to support this. TOOO: and the query syntax would be more verbose (Created.YearNumber = ThisYear or something similar, instead of just Created = ThisYear).)

Note that the concept is inherently expandable, you can create your own sub-classes and integrate them with StandardAgoRapideCode.
Note how any ApplicationSpecificCode implementations must be added to Parsers at application startup in order for them to be recognized by TryParse.
InterfacesARCCore.ITypeDescriber; -System.IEquatable`1[ARCQuery.FunctionKey]-

5 items


Generated 2020-10-13 11:11:07.739 UTC