chore: Add 'Rows' prop to BlueTable to avoid accidentally iterating over KeyValuePairs

This commit is contained in:
John Colvin committed 2025-11-19 14:01:02 -05:00
1 parent d8d9a25f22
commit a3bee2313a
1 file changed
+4 -1
@@ -81,6 +81,9 @@ namespace BCG {
/// <param name="schema"></param>
public BlueTable(IBlueTableSchema schema) { mySchema = schema; }
public ICollection<IBlueRow> Rows =>
GenericCollectionWrapper.Create<IBlueRow>(myIdIndex.Values);
public static BlueTable Empty(string name, bool includeIdColumn = true) =>
new(BlueTableSchema.Empty(name, includeIdColumn));
@@ -279,7 +282,7 @@ namespace BCG {
GenericCollectionWrapper.Create<int>(myIdIndex.Keys);
ICollection<IBlueRow> IDictionary<int, IBlueRow>.Values =>
GenericCollectionWrapper.Create<IBlueRow>(myIdIndex.Values);
Rows;
bool ICollection<KeyValuePair<int, IBlueRow>>.IsReadOnly => false;
#endregion