Beispiel #1
0
 public RecordToDbAdapter(ITableStructure recordFormat, ITableStructure targetTable, ISqlDialect targetDialect, DataFormatSettings formatSettings)
 {
     m_dstColTypes = new List <DbTypeBase>();
     foreach (var col in recordFormat.Columns)
     {
         m_dstColTypes.Add(targetTable.Columns[col.ColumnName].DataType);
     }
     m_dda        = targetDialect.CreateDataAdapter();
     m_outputConv = new BedValueConvertor(formatSettings);
 }
 public void AdaptValue(IBedValueReader reader, DbTypeBase type, IBedValueWriter writer, IBedValueConvertor converter, ILogger logger)
 {
     if (reader.GetFieldType() == TypeStorage.Null)
     {
         m_holder.SetNull();
     }
     else
     {
         converter.ConvertValue(reader, type.DefaultStorage, m_holder);
         ApplyTypeRestrictions(m_holder, type, logger);
     }
     writer.ReadFrom(m_holder);
 }