[ROOT] / doc / DocFrag / ARCCore.PK.GetTypeMapping
| Key | Value | 
|---|---|
| Assembly | ARCCore | 
| DocFragType | ClassMember | 
| IsInherited | -False- | 
| IsInheritedDoc | -False- | 
| Lines | -13- | 
| Name | GetTypeMapping | 
| Namespace | ARCCore | 
| Type | PK | 
ClassMemberAttribute
| Key | Value | 
|---|---|
| DeclaringType | PK | 
| MethodName | GetTypeMapping | 
| MethodSignature | ARCCore.PK GetTypeMapping(System.Type, System.Type) | 
Returns the relevant property key for a given type entity-type and field-type.
This enables the use of convenience 'mapping' methods like AddPM, AddPVM, GetPM, TryGetPM, GetPVM, TryGetPVM which have a simpler syntax.
For instance if you have a class called DateOfBirth, and a corresponding field for your Customer-class (normally also called DateOfBirth), then you can use Customer.GetPVM<DateOfBirth>() instead of Customer.GetPV<DateOfBirth>(CustomerP.DateOfBirth).
(The approach works only as long as there is only a single DateOfBirth-field in your Customer-class).
Note that if you in this specific case did not use a specific class like DateOfBirth, but just the DateTime-type, and there is ONLY one DateTime field for Customer, this approach still works but the syntax is not as intuitive (it becomes Customer.GetPVM<DateTime>() instead of Customer.<DateTime>(CustomerP.DateOfBirth).
Note that throws an exception if exactly one type not found. In other words, caller is assume to know the proper use of the entity class.
TODO: Turn into TryGetTypeMapping with corresponding method GetTypeMapping throwing an exception like this method does today.
This is a convenience functionality, not strictly needed. It just reduces the somewhat verbose syntax of AgoRapide's PropertyAccess. Note that it is also possible to define traditional setters / getters in your entity classes, giving you 'normal' syntax back, like Customer.DateOfBirth.
Generated 2025-10-30 23:46:24.963 UTC