Skip to content

Commit 9747fec

Browse files
author
electricessence
committed
Added ability to ignore fields.
1 parent e1fd7ba commit 9747fec

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Transformer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ public Transformer(IEnumerable<KeyValuePair<string, string>> overrides = null)
3131
if (overrides != null)
3232
{
3333
foreach (var o in overrides)
34-
PropertyMap[o.Key] = o.Value;
34+
{
35+
var v = o.Value;
36+
if (v == null) PropertyMap.Remove(o.Key); // Null values indicate a desire to 'ignore' a field.
37+
else PropertyMap[o.Key] = o.Value;
38+
}
3539
}
3640

3741
ColumnToPropertyMap = PropertyMap.ToDictionary(kvp => kvp.Value, kvp => pm[kvp.Key]);

0 commit comments

Comments
 (0)