improve: Support enum types in ColumnInfo

This commit is contained in:
John Colvin committed 2025-11-15 12:46:25 -05:00
1 parent 0ff372a63e
commit afeb5babd4
2 files changed
+9 -1

No files matched your search

@@ -831,6 +831,11 @@ namespace BCG {
if (kv.Value == t)
return kv.Key;
}
if (t.IsEnum) {
return get_typecode(t.GetEnumUnderlyingType());
} else if (t.IsNullable()) {
return get_typecode(t.GetGenericArguments()[0]);
}
//bts.Log.assert_d(false, $"type: {t} not found");
return TypeCode.Empty;
}
@@ -30,7 +30,10 @@ namespace BCG {
type == typeof(long) ||
type == typeof(double) ||
type == typeof(string) ||
type == typeof(DateTime);
type == typeof(DateTime) ||
type == typeof(TimeSpan) ||
(type.IsEnum && isAllowedType(type.GetEnumUnderlyingType())) ||
(type.IsNullable() && isAllowedType(type.GetGenericArguments()[0]));
public int CompareTo(ColumnInfo? other) =>
other is null ? 1 : colNo.CompareTo(other.colNo);