private void Print(FolderSearcher searcher, IEnumerable <string> seenProcs, int level) { _log($"{Padding(level)}{ConstructSPName()}"); foreach (var innderProc in FindInner(searcher)) { if (seenProcs.Contains(innderProc.ConstructSPName())) { _log($"{Padding(level + 1)}{innderProc.ConstructSPName()}..."); } else { innderProc.Print(searcher, seenProcs.Concat(new[] { innderProc.ConstructSPName() }), level + 1); } } }
private IEnumerable <StoredProcedureInfo> FindInner(FolderSearcher searcher) => EnumerateInnerProcedures() .Select(d => searcher.Search(d.Name, d.Schema)) .Where(a => a != null);
public void Print(FolderSearcher searcher) => Print(searcher, new List <string>(), 0);
public StoredProcedureMapper(string path, Action <string> log) { _searcher = new FolderSearcher(path, log); }