Click or drag to resize

MFIdentiferToIDConverter Class

Converts an structure element reference value in a source JSON structure to an explicit ID in a target JSON structure. A ghost property will be added to the target JSON structure to preserve the original references used for the item. The ghost property will be named using the name of the property that contains the id value, followed by "-OriginalReferences". Typically the ghost properties can be converted back to references by the IDToMFIdentiferConverter. For example the source json: { ObjType: "ObjType1", Classes: [ "Class1", "Class2" ] } might get converted to a target like so: { objTypeID: 110, objTypeID-OriginalReferences: "ObjType1", classIDs: [ 2, 4 ], classIDs-OriginalReferences: [ "Class1", "Class2" ] }
Inheritance Hierarchy

Namespace:  MFiles.VAF.Configuration.JsonMapping.Converters
Assembly:  MFiles.VAF.Configuration (in MFiles.VAF.Configuration.dll) Version: 21.8.10524.1
public class MFIdentiferToIDConverter : IJsonValueConverter

The MFIdentiferToIDConverter type exposes the following members.

Public propertyResolver
Used to resolve id's from references.
Public propertyType
The type of structure element being IDed/Referenced.
Public propertyWriteIdAsString
Indicates whether we should write the id values as strings instead of integers.
Public methodConvertValue
Ensures that any non-numeric source values are resolved to an explicit id in the target value. Additionally a ghost value may be added to the target value's parent object to retain the original reference.
Public methodGetIdValue
Gets a JSON compatible value from the id.
Public methodInvert
Provides a reverse converter, for mapping values in the opposite direction.
See Also