private IRecord GetRecordFromTableRow(IRecordType recordType, object[] row, ISchema schema) { IRecord record = new Record(recordType); foreach (var field in recordType.Fields) { var column = schema.GetField(field.Name); if (column != null && column.Type == field.Type.UnterlyingDotNetType) { int fieldPosition = schema.GetFieldPosition(field.Name); IValue value = new TypedValue(field.Type, row[fieldPosition]); record.SetFieldValue(field.Name, value); } } return(record); }