Added basic configuration

This commit is contained in:
2025-01-14 11:34:57 +01:00
parent e093d01c6a
commit f0bc9e23b8
30 changed files with 860 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
using HopFrame.Core.Config;
namespace HopFrame.Core.Services.Implementations;
internal sealed class ContextExplorer(HopFrameConfig config) : IContextExplorer {
public IEnumerable<string> GetTableNames() {
foreach (var context in config.Contexts) {
foreach (var table in context.Tables) {
if (table.Ignored) continue;
yield return table.PropertyName;
}
}
}
public TableConfig? GetTable(string name) {
foreach (var context in config.Contexts) {
var table = context.Tables.FirstOrDefault(table => table.PropertyName == name);
if (table is not null)
return table;
}
return null;
}
}