Source/NFX/Serialization/JSON/JSONReader.cs
/// <summary>
/// Converts JSONMap into supplied row instance.
/// The extra data found in JSON map will be placed in AmorphousData dictionary if the row implemets IAmorphousData, discarded otherwise.
/// Note: This method provides "the best match" and does not guarantee that all data will/can be converted from JSON, i.e.
///  it can only convert one dimensional arrays and Lists of either primitive or TypeRow-derived entries
/// </summary>
/// <param name="row">Row instance to convert into</param>
/// <param name="jsonMap">JSON data to convert into row</param>
/// <param name="fromUI">When true indicates that data came from UI, hence NonUI-marked fields should be skipped. True by default</param>
/// <param name="nameBinding">Used for backend name matching or null (any target)</param>
Converts JSONMap into supplied row instance.
The extra data found in JSON map will be placed in AmorphousData dictionary if the row implemets IAmorphousData, discarded otherwise.
Note: This method provides "the best match" and does not guarantee that all data will/can be converted from JSON, i.e.
it can only convert one dimensional arrays and Lists of either primitive or TypeRow-derived entries
Converts JSONMap into supplied row instance . The extra data found in JSON map will be placed in AmorphousData dictionary if the row implemets IAmorphousData discarded otherwise . Note : This method provides " the best match " and does not guarantee that all data will / can be converted from JSON i . e . it can only convert one dimensional arrays and Lists of either primitive or TypeRow - derived entries
public static void ToRow(Row row, JSONDataMap jsonMap, bool fromUI = true, NameBinding? nameBinding = null)
            {
              if (row == null || jsonMap == null)
                throw new JSONDeserializationException(StringConsts.ARGUMENT_ERROR + "JSONReader.ToRow(row|jsonMap=null)");
              var field = "";
              try
              {
                toRow(row, nameBinding.HasValue ? nameBinding.Value : NameBinding.ByCode, jsonMap, ref field, fromUI);
              }
              catch (Exception error)
              {
                throw new JSONDeserializationException("JSONReader.ToRow(row, jsonMap) error in '{0}': {1}".Args(field, error.ToMessageWithType()), error);
              }
            }
public static void ToRow ( Row row , JSONDataMap jsonMap , bool fromUI = true , NameBinding ? nameBinding = null ) { if ( row == null || jsonMap == null ) throw new JSONDeserializationException ( StringConsts . ARGUMENT_ERROR + " " ) ; var field = " " ; try { toRow ( row , nameBinding . HasValue ? nameBinding . Value : NameBinding . ByCode , jsonMap , ref field , fromUI ) ; } catch ( Exception error ) { throw new JSONDeserializationException ( " " . Args ( field , error . ToMessageWithType ( ) ) , error ) ; } }
Converts JSONMap into supplied row instance.
Converts JSONMap into supplied row instance .
row
Row
Row instance to convert into
Row instance to convert into
jsonMap
JSONDataMap
JSON data to convert into row
JSON data to convert into row
fromUI
bool
When true indicates that data came from UI, hence NonUI-marked fields should be skipped. True by default
When true indicates that data came from UI hence NonUI - marked fields should be skipped . True by default
nameBinding
NameBinding?
Used for backend name matching or null (any target)
Used for backend name matching or null ( any target )