cleanup: Fix more build warnings in DataStreamSuite
Alot more
This commit is contained in:
1 parent
989d103eef
commit
bcd207f89e
118 files changed
+1812
-1597
No files matched your search
@@ -1,11 +1,8 @@
|
||||
using mbts;
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
using BCG;
|
||||
using BCG.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using mbts;
|
||||
|
||||
namespace BCG
|
||||
{
|
||||
public class NullToConstantMapper : IStreamMapper
|
||||
@@ -27,17 +24,11 @@ namespace BCG
|
||||
|
||||
#region IDynamicStreamMapper Members
|
||||
|
||||
public IBlueRow map(IBlueRow row)
|
||||
{
|
||||
if(row[myField].Equals(DBNull.Value))
|
||||
{
|
||||
Hashtable newRow = new Hashtable(row);
|
||||
newRow[myField]= myConstant;
|
||||
return new BlueRow(row.schema, newRow);
|
||||
}
|
||||
else
|
||||
return row;
|
||||
}
|
||||
public IBlueRow map(IBlueRow row) =>
|
||||
row[myField] switch {
|
||||
null or DBNull => new BlueRow(row.schema, new Hashtable(row) { { myField, myConstant } }),
|
||||
_ => row,
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -69,10 +60,11 @@ namespace BCG
|
||||
Hashtable newRow = new Hashtable(row);
|
||||
foreach(ColumnInfo info in row.schema.columnInfo)
|
||||
{
|
||||
if(row[info.colName].Equals(DBNull.Value))
|
||||
{
|
||||
change = true;
|
||||
newRow[info.colName] = Convert.ChangeType(myConstant, info.colType);
|
||||
switch (row[info.colName]) {
|
||||
case null or DBNull:
|
||||
change = true;
|
||||
newRow[info.colName] = Convert.ChangeType(myConstant, info.colType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(change)
|
||||
|
||||
Reference in new issue
Block a user