public void Parse(ModelMap.ModelMap map, string filePath) { var overrides = new ModelMap.ModelMap(map.Name, map.Entity); _inner.Parse(overrides, filePath); _diff.Diff(map, overrides, _options); }
private ModelMap.ModelMap[] findMaps(string include) { lock (Lock) { var files = new FileSystem(); var mapFiles = files.FindFiles(_settings.Directory, new FileSet { Include = include, DeepSearch = true }).ToArray(); var maps = mapFiles .Where(_ => !_overrides.ShouldParse(_)) // && !_replacements.ShouldParse(_)) .Select(_ => _parser.Parse(_)) .OrderBy(_ => _.Name) .ToArray(); var conflicts = maps.GroupBy(_ => _.Name).Where(_ => _.Count() > 1).ToArray(); if (conflicts.Any()) { throw new ModelMapException("Multiple history models found with the same name: " + conflicts.Select(_ => _.Key).Join(", ")); } mapFiles .Where(_ => _overrides.ShouldParse(_)) .Each(_ => maps .Where(__ => _overrides.Matches(__, _)) .Each(__ => _overrides.Parse(__, _))); //mapFiles // .Where(_ => _replacements.ShouldParse(_)) // .Each(_ => maps // .Where(__ => _replacements.Matches(__, _)) // .Each(__ => _replacements.Parse(__, _))); return(maps); } }