Source/NFX.Erlang/DataAccess/SchemaMap.cs
/// <summary>
/// Converts ErlCRUD response to CLR CRUD rowset
/// </summary>
/// <remarks>
/// An Example data packet is field defs as speced in schema:
/// "tca_jaba": has two field in PK
/// [
///    {tca_jaba, {1234, tav}, "User is cool", true},
///    {tca_jaba, {2344, zap}, "A bird wants to drink", false},
///    {tca_jaba, {8944, tav}, "Have you seen this?", false}
/// ]
///
/// "aaa": has one field in PK - notice no tuple in key
/// [
///    {aaa, 1234, tav, "User is cool", true},
///    {aaa, 2344, zap, "A bird wants to drink", false},
///    {aaa, 8944, tav, "Have you seen this?", false}
/// ]
/// </remarks>
Converts ErlCRUD response to CLR CRUD rowset
Converts ErlCRUD response to CLR CRUD rowset
public RowsetBase ErlCRUDResponseToRowset(string schemaName, ErlList erlData, Type tRow = null)
    {
      var crudSchema = GetCRUDSchemaForName(schemaName);
      var tSchema    = tRow == null
        ? crudSchema
        : Schema.GetForTypedRow(tRow);
      var result = new Rowset(tSchema);
      foreach(var elm in erlData)
      {
        var tuple = elm as ErlTuple;
        if (tuple==null)
          throw new ErlDataAccessException(StringConsts.ERL_DS_INVALID_RESP_PROTOCOL_ERROR+"ErlCRUDResponseToRowset(list element is not tuple)");
        var row = ErlTupleToRow(schemaName, tuple, crudSchema);
        if (tRow != null)
        {
          var trow = Row.MakeRow(tSchema, tRow);
          row.CopyFields(trow);
          row = trow;
        }
        result.Add( row );
      }
      return result;
    }
public RowsetBase ErlCRUDResponseToRowset ( string schemaName , ErlList erlData , Type tRow = null ) { var crudSchema = GetCRUDSchemaForName ( schemaName ) ; var tSchema = tRow == null ? crudSchema : Schema . GetForTypedRow ( tRow ) ; var result = new Rowset ( tSchema ) ; foreach ( var elm in erlData ) { var tuple = elm as ErlTuple ; if ( tuple == null ) throw new ErlDataAccessException ( StringConsts . ERL_DS_INVALID_RESP_PROTOCOL_ERROR + " " ) ; var row = ErlTupleToRow ( schemaName , tuple , crudSchema ) ; if ( tRow != null ) { var trow = Row . MakeRow ( tSchema , tRow ) ; row . CopyFields ( trow ) ; row = trow ; } result . Add ( row ) ; } return result ; }
Converts ErlCRUD response to CLR CRUD rowset
Converts ErlCRUD response to CLR CRUD rowset
schemaName
string
erlData
ErlList
tRow
Type
remarks
An Example data packet is field defs as speced in schema:
"tca_jaba": has two field in PK
[
{tca_jaba, {1234, tav}, "User is cool", true},
{tca_jaba, {2344, zap}, "A bird wants to drink", false},
{tca_jaba, {8944, tav}, "Have you seen this?", false}
]

"aaa": has one field in PK - notice no tuple in key
[
{aaa, 1234, tav, "User is cool", true},
{aaa, 2344, zap, "A bird wants to drink", false},
{aaa, 8944, tav, "Have you seen this?", false}
]
An Example data packet is field defs as speced in schema : " tca_jaba " : has two field in PK [ { tca_jaba { 1234 tav } " User is cool " true } { tca_jaba { 2344 zap } " A bird wants to drink " false } { tca_jaba { 8944 tav } " Have you seen this? " false } ] " aaa " : has one field in PK - notice no tuple in key [ { aaa 1234 tav " User is cool " true } { aaa 2344 zap " A bird wants to drink " false } { aaa 8944 tav " Have you seen this? " false } ]