24 lines
684 B
C#
24 lines
684 B
C#
using System.Collections.Generic;
|
|
|
|
namespace ExcelKv.Core;
|
|
|
|
// --- Schema Middleware ---
|
|
public class SchemaRegistry
|
|
{
|
|
private Dictionary<string, HashSet<string>> _knownSchemas = new();
|
|
|
|
public void RegisterSchema(string namespaceKey, List<string> newColumns)
|
|
{
|
|
if (!_knownSchemas.ContainsKey(namespaceKey))
|
|
{
|
|
_knownSchemas[namespaceKey] = new HashSet<string>();
|
|
foreach (var col in newColumns) _knownSchemas[namespaceKey].Add(col);
|
|
}
|
|
else
|
|
{
|
|
var existing = _knownSchemas[namespaceKey];
|
|
foreach (var col in newColumns) if (!existing.Contains(col)) existing.Add(col);
|
|
}
|
|
}
|
|
}
|