Source/NFX/Serialization/BSON/RowConverter.cs
/// <summary>
/// Converts BSON document into Row by filling the supplied row instance making necessary type transforms to
///  suit Row.Schema field definitions per target name. If the passed row supports IAmorphousData, then
/// the fields either not found in row, or the fields that could not be type-converted to CLR type will be
/// stowed in amorphous data dictionary
/// </summary>
Converts BSON document into Row by filling the supplied row instance making necessary type transforms to
suit Row.Schema field definitions per target name. If the passed row supports IAmorphousData, then
the fields either not found in row, or the fields that could not be type-converted to CLR type will be
stowed in amorphous data dictionary
Converts BSON document into Row by filling the supplied row instance making necessary type transforms to suit Row . Schema field definitions per target name . If the passed row supports IAmorphousData then the fields either not found in row or the fields that could not be type - converted to CLR type will be stowed in amorphous data dictionary
public virtual void BSONDocumentToRow(BSONDocument doc, Row row, string targetName, bool useAmorphousData = true, Func<BSONDocument, BSONElement, bool> filter = null)
    {
      if (doc==null || row==null) throw new BSONException(StringConsts.ARGUMENT_ERROR+"BSONDocumentToRow(doc|row=null)");
      var amrow = row as IAmorphousData;
      foreach(var elm in doc)
      {
        if (filter!=null)
          if (!filter(doc, elm)) continue;
        var fld = MapBSONFieldNameToSchemaFieldDef(row.Schema, targetName, elm.Name);
        if (fld==null)
        {
            if (amrow!=null && useAmorphousData && amrow.AmorphousDataEnabled)
              SetAmorphousFieldAsCLR(amrow, elm, targetName, filter);
            continue;
        }
        var wasSet = TrySetFieldAsCLR(row, fld, elm, targetName, filter);
        if (!wasSet)
        {
          if (amrow!=null && useAmorphousData && amrow.AmorphousDataEnabled)
              SetAmorphousFieldAsCLR(amrow, elm, targetName, filter);
        }
      }
      if (amrow!=null && useAmorphousData && amrow.AmorphousDataEnabled)
      {
          amrow.AfterLoad(targetName);
      }
    }
public virtual void BSONDocumentToRow ( BSONDocument doc , Row row , string targetName , bool useAmorphousData = true , Func < BSONDocument , BSONElement , bool > filter = null ) { if ( doc == null || row == null ) throw new BSONException ( StringConsts . ARGUMENT_ERROR + " " ) ; var amrow = row as IAmorphousData ; foreach ( var elm in doc ) { if ( filter != null ) if ( ! filter ( doc , elm ) ) continue ; var fld = MapBSONFieldNameToSchemaFieldDef ( row . Schema , targetName , elm . Name ) ; if ( fld == null ) { if ( amrow != null && useAmorphousData && amrow . AmorphousDataEnabled ) SetAmorphousFieldAsCLR ( amrow , elm , targetName , filter ) ; continue ; } var wasSet = TrySetFieldAsCLR ( row , fld , elm , targetName , filter ) ; if ( ! wasSet ) { if ( amrow != null && useAmorphousData && amrow . AmorphousDataEnabled ) SetAmorphousFieldAsCLR ( amrow , elm , targetName , filter ) ; } } if ( amrow != null && useAmorphousData && amrow . AmorphousDataEnabled ) { amrow . AfterLoad ( targetName ) ; } }
Converts BSON document into Row by filling the supplied row instance making necessary type transforms to
suit Row.Schema field definitions per target name.
Converts BSON document into Row by filling the supplied row instance making necessary type transforms to suit Row . Schema field definitions per target name .
// 2015.03.01 Introduced caching //again dump it in amorphous
doc
BSONDocument
row
Row
targetName
string
useAmorphousData
bool
filter
Func<BSONDocument, BSONElement, bool>