Root / Assembly / ARCCore / Class / IP / _Member

PRich

_Member

KeyValue
AddPAdds a property for this object.

Throws -KeyAlreadyExistsException- when relevant.


Description, MethodName, MethodSignature, ReflectedType
AddPVAdds a property value (as a PValue<T>) for this objectThrows -KeyAlreadyExistsException- when relevant.


Description, MethodName, MethodSignature, ReflectedType
AllIPDerivedTypesAll relevant IP-derived types for the whole application.

Note how IP is NOT included in this collection. The same goes for generic and abstract types.
TODO: Ascertain reason for why that is so.
TODO. Define more clearly purpose of this method.

TODO: Probably this method is not in use as of May 2020.

See also AllIPDerivedTypesInludingGenericAndAbstract.

Probable faster methods to call are one of
AllIPDerivedTypesDict or
AllIPDerivedTypesDictIKType.

Description, MethodName, MethodSignature, ReflectedType
AllIPDerivedTypesDictOffers for lookup of a type given its string representation.

Keys are all the following possible string representations of type:
ToStringVeryShort
ToStringShort
ToStringDB
ToString


Description, MethodName, MethodSignature, ReflectedType
AllIPDerivedTypesDictIKTypeSame as AllIPDerivedTypesDict except that value is IKType, not string.
(saves the calling method from construction an IKType from the type returned.)

Description, MethodName, MethodSignature, ReflectedType
AllIPDerivedTypesInludingGenericAndAbstractAll relevant IP-derived types (except the interface IP itself) known to the application.

HACK: Hack because AllIPDerivedTypes is too restrictive.

Description, MethodName, MethodSignature, ReflectedType
AssertIntegritySee TryAssertIntegrity.

Description, MethodName, MethodSignature, ReflectedType
Boolean TryGetP(ARCCore.IK, ARCCore.IP ByRef)Note that not relevant for single-value properties like PValue<T>.

Description, MethodName, MethodSignature, ReflectedType
Boolean TryGetP(ARCCore.IK, ARCCore.IP ByRef, System.String ByRef)Gets a single property for this object
Note that not relevant for single-value properties like PValue<T>.

Description, MethodName, MethodSignature, ReflectedType
Boolean TryGetV[T](T ByRef)The actual value of the property. Mostly relevant for single-value properties like PValue<T>.

Description, LongDescription, MethodName, MethodSignature, ReflectedType
Boolean TryGetV[T](T ByRef, System.String ByRef)The actual 'unpacking' of the object.

(corresponds to PackObjectForStorageInEntityObject.

Description, MethodName, MethodSignature, ReflectedType
DecDecrements given property key by 1. Sets to -1 if not found. Uses long, not integer.

Description, MethodName, MethodSignature, ReflectedType
DeepCopyCreates a deep copy of this object instance, that is, a copdy with all new object instances (except for immutable objects).
Implementing classes are supposed to use this method recursively for a truly deep copy.

Note that there may be some limitations in the implementing class for how truly deep the copy is. For instance if the actual value (TValue) of PValue<T> is not immutable, then the copy returned will not be a truly deep copy

Description, MethodName, MethodSignature, ReflectedType
EnumeratorReturnsEmptyCollectionHint for how to avoid calling enumerator.Count() when all you need is to decide if collection is empty or not.


Description, MethodName, MethodSignature, ReflectedType
GetPGets a single property for this object.
Note that not relevant for single-value properties like PValue<T>.
Throws exception if property not found.
TODO: Consider looking for a DefaultValue before throwing an exceptions.
TODO: (as of Apr 2020 system depends on AssertIntegrity having being called in order to set default values).

Description, MethodName, MethodSignature, ReflectedType
GetValueForJSONSerializerMakes the following modifications to the data:

1) Replaces Type with String
(in order to avoid exception being thrown by System.Text.Json.JsonSerializer.Serialize (issue in 4.7.2 and probably later versions also))

2) Replaces enums with their string representation
(in order to avoid int-representation being used by System.Text.Json.JsonSerializer.Serialize).
NOTE: Strictly speaking this functionality really belongs in ARCQuery / ARCAPI.


Description, MethodName, MethodSignature, ReflectedType
HandleExceptionNote that most relevant to use for PConcurrent.
Using this method within an ordinary entity class like PRich will only store the exception data 'out-of-sight' within the object instance, it will not be sent to the PropertyStream.

See -ExceptionText for more details.

Description, MethodName, MethodSignature, ReflectedType
IncIncrements given property key by 1. Sets to 1 if not found. Uses long, not integer.

Description, MethodName, MethodSignature, ReflectedType
InitializeNote that has a default implementation (doing nothing).
Any implementation should start with a call to AssertIntegrity.

Description, MethodName, MethodSignature, ReflectedType
IsValidNote that by default all properties are 'valid' but because of NoRealDeletion, we must have a mechanism for invalidating properties. This property returns FALSE if property has been invalidated and timestamp for invalidation is not '0001-01-01'.

Description, LongDescription, MethodName, MethodSignature, ReflectedType
ItemOffers string-based direct indexing.

Enables you to query more 'direct' like for instance 'DataStorage["Customer"]["42"]["FirstName"]'.

This is especially useful in debugging situations.
(except that for the unfortunate situation as of May 2020 that you often get the 'The debugger is unable to evaluate this expression' message when actually trying to use this in a debugging scenario).

Description, MethodName, MethodSignature, ReflectedType
KeysReturns all the keys for this instance.

Description, MethodName, MethodSignature, ReflectedType
LogNote that most relevant to use for a class like PConcurrent with concept of LogContext. (using this method within an ordinary entity class like PRich will only store the log-data 'out-of-sight' within the object instance, it will not be sent to the PropertyStream.)
(it will of course be written to the Console anyway if writeToConsole is specified)

See log for more details.

Description, MethodName, MethodSignature, ReflectedType
LogContextDescribes how 'logging' of calls to -SetP- should be done.
If not set, then logging will not be done.
Note that this is a special property not used by most implementations of IP.
It is relevant for ExposingApplicationState to the property stream.

Note that when set, parameter writeToConsole in calls to Log will be ignored (because it is assumed that the data will be written eventually through the logger-mechanism anyway).

Note how the default interface property is just a dummy property. (it is present in order to enable writing to console with the log context at call to Log).
As of Apr 2020 the only class actual supporting LogContext is PConcurrent.

See also log.

Description, MethodName, MethodSignature, ReflectedType
LogExecuteTimeTimes the execution of the given function and logs details about elapsed time.
Example of log output (with properties parameter containing two keys, 'propertiesKeyA' and 'propertiesKeyB'):
log/[LogContext]/log = [MethodName]/[ThreadName]/[ThreadId]/Start = 2020-06-03 13:20:59.760
log/[LogContext]/log = [MethodName]/[ThreadName]/[ThreadId]/propertiesKeyA = Value of A
log/[LogContext]/log = [MethodName]/[ThreadName]/[ThreadId]/propertiesKeyA = Value of B
log/[LogContext]/log = [MethodName]/[ThreadName]/[ThreadId]/Finish = 2020-06-03 13:21:00.766
log/[LogContext]/log = [MethodName]/[ThreadName]/[ThreadId]/ElapsedTime = 00:00:01.005


Description, MethodName, MethodSignature, ReflectedType
OnTrySetPEvent handler to be called by TrySetP before it changes a property value (but AFTER it has done any validity checks, that is, after is has 'decided' to return TRUE, in other words, event handler should be called when change is guaranteed to go through, but before it actually has been done).

Return value TRUE is to be treated as cancel, that is, the change should not go through after all.

Some uses for this event handler could be:
1) Recording historical values, before they are overwritten by new values (but see also Cardinality.

Description, MethodName, MethodSignature, ReflectedType
T GetOrAddPV[T](ARCCore.IK, System.Func`1[T])Gets value. If not set then value will be added

Description, MethodName, MethodSignature, ReflectedType
T GetOrAddPV[T](ARCCore.IK, T)Gets value. If not set then value will be added

Description, MethodName, MethodSignature, ReflectedType
T GetOrAddPV[TKey,T](TKey, System.Func`1[T])Gets value. If not set then value will be added

Description, MethodName, MethodSignature, ReflectedType
T GetOrAddPV[TKey,T](TKey, T)Gets value. If not set then value will be added

Description, MethodName, MethodSignature, ReflectedType
T GetPV[T](System.Object)Gets a single property's value for this object.

Note that not relevant for single-value properties like PValue<T>.

Description, MethodName, MethodSignature, ReflectedType
ToJSONSerializeablePrepares the data into a format acceptable for System.Text.Json.JsonSerializer.Serialize.
(used by ARCAPI (which again uses System.Text.Json version 4.7.2 as of Aug 2020)).

This default implementation will for instance replace Type with String.

Note that there is no corresponding JSON Deserialize-method (as JSON is not a suitable serialization mechanism for PropertyStream).
See ToPropertyStream for more information about serialization / deserialization.

NOTE: Strictly speaking this functionality really belongs in ARCQuery / ARCAPI.


Description, MethodName, MethodSignature, ReflectedType
ToPropertyStreamTurns object into a PropertyStream
Usually to be called initially (from 'outside') with no parameters.
This is AgoRapide's main serialization mechanism.
The main deserialization mechanism is TryStore (together with TryParse).

NOTE: 'final' implementations, that is, classes containing an actual value has to implement this method explicitly.
NOTE: See ToPropertyStream and ToPropertyStream.


Description, MethodName, MethodSignature, ReflectedType
ToStringThe ToString()-implementation in the classes implementing this interface is supposed to give a short concise representation of the object for debugging and logging purposes, that is, intended for human consumption. The most 'important' implementation is probably the one in PRich (ToString) because that one is often the basis for your entity classes like 'Customer', 'Order' and so on

Description, LongDescription, MethodName, MethodSignature, ReflectedType
TryAssertIntegrityAsserts the integrity of this entity.
As of Mar 2020 this consists of asserting that all obligatory values are set (based on IsObligatory.).

Note: Will also add any missing missing obligatory values if a DefaultValue is found.

Description, MethodName, MethodSignature, ReflectedType
TryGetPVGets a single property's value for the given property key.

Note that not relevant for single-value properties like PValue<T>.

Description, MethodName, MethodSignature, ReflectedType
TrySetPSet property regardless of whether exists or not.

Note that not relevant for single-value properties like PValue<T>.

Some reasons for FALSE being returned may be like the following:

1) Parameter IKIP found inconsistent at call to TryAssertTypeIntegrity.
(note that all implementing classes of IP should call TryAssertTypeIntegrity in their implementation of this method (TrySetP)).

2) This instance of IP does not accept the given key. This again may have different reasons:

2a) This instance is a 'value only' instance like PValue<T>, simply not accepting properties at all (see also Value).

2b) This instance is a PExact<EnumType> which only accepts keys of a specific -PropertyKeyEnum (like the Banana-class in ARCDoc only accepting keys from BananaP).

2c) TODO: Not implemented. The key is not in a pre-defined collection of keys that this instance accepts (Note: By default, classes like PRich accepts any key).

Description, MethodName, MethodSignature, ReflectedType
TValue GetPV[TKey,TValue](TKey, TValue)Gets a single property's value for this object. Returns default value if not successful.
Note that default value returned is the actual parameter to this method, not any DefaultValue.

Note that not relevant for single-value properties like PValue<T>.

Description, MethodName, MethodSignature, ReflectedType
ValuesReturns all the values (all the properties) for this instance.

Description, MethodName, MethodSignature, ReflectedType
Void AddOrUpdateP(ARCCore.IK, ARCCore.IP)Duplicates functionality of SetP (offered in order to look similar to for instance ConcurrentDictionary)

Description, MethodName, MethodSignature, ReflectedType
Void AddOrUpdateP[TKey](TKey, ARCCore.IP)Duplicates functionality of SetP (offered in order to look similar to for instance ConcurrentDictionary)

Description, MethodName, MethodSignature, ReflectedType
Void SetLogContext(System.Collections.Generic.List`1[ARCCore.IK], System.Action`1[System.String])Convenience method for setting LogContext.
Prepends log to context if not already done.

Description, MethodName, MethodSignature, ReflectedType
Void SetLogContext(System.String, System.Action`1[System.String])Convenience method for setting LogContext.
Prepends log to context if not already done.

Description, MethodName, MethodSignature, ReflectedType

43 items


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