Root / Assembly / ARCCore / Class / Extensions / _Member / ToStringDB
|Description||Gives the minimum representation of type as string suitable for later reconstruction by -GetType-.|
(that is with namespace and including all relevant assembly names but nothing more)
The returned string even takes into consideration generics when the generic type resides in a different assembly.
The return value is considered SQL-"safe" in the sense that it may be inserted directly into an SQL statement (not relevant for new AgoRapide (2020) though).
Corresponding method for getting the type back is TryGetTypeFromStringFromCache.
Note how caches result since operation is somewhat complicated due do generic types.
Note how returns a string.Intern in order to make for quicker dictionary lookup as returned string will often be used for lookup in other caches.
|LongDescription||TODO: GIVE BETTER EXAMPLE below because ApplicationPart does not exist in new AgoRapide (2020).|
Example of return value is:
ApplicationPart<P>; : AgoRapide.ApplicationPart`1[AgoRapideSample.P,AgoRapideSample],AgoRapide
(the part before : is what is returned by ToStringShort and serves as a human readable shorthand)
Note complexities involved around generic types where the generic argument exist in a different assembly.
For instance for:
where ApplicationPart resides in AgoRapide and
P resides in AgoRapideSample a simple approach like
ToString , Assembly.-GetName-
which is not enough information for -GetType-
Therefore, for types where generic arguments exist in a different assembly we have to do like explained here:
In our case what is returned by this methdod is something like mentioned above
that is, we insert the assembly name where the type of the generic parameter resides, into the string.
Generated 2020-10-13 11:11:03.723 UTC