public Specification Generate() { var behaviorMappings = GetBehaviorMapping(_behaviors.GetChains()); CheckForOrphanedChains(behaviorMappings); var modules = GetModules(behaviorMappings.Where(x => x.Module != null).ToList()); var resources = GetResources(behaviorMappings.Where(x => x.Module == null).ToList()); if (resources.Any()) { modules.Add(new Module { Name = Module.DefaultName, Resources = resources }); } var specification = new Specification { FavIconUrl = _configuration.FavIconUrl, Title = _configuration.Title ?? _configuration.Name, Name = _configuration.Name, LogoUrl = _configuration.LogoUrl, Comments = _configuration.AppliesToAssemblies.FindTextResourceNamed("*" + _configuration.Comments), Modules = modules }; return(specification); }
public Specification Generate() { var behaviorMappings = GetBehaviorMapping(_behaviors.GetChains()); CheckForOrphanedChains(behaviorMappings); var specification = new Specification { Name = _configuration.Name, Comments = _configuration.AppliesToAssemblies .Select(x => x.FindTextResourceNamed("*" + _configuration.Comments)) .FirstOrDefault(x => x != null), Types = GatherInputOutputModels(behaviorMappings.Select(x => x.Chain).ToList()), Modules = GetModules(behaviorMappings.Where(x => x.Module != null).ToList()), Resources = GetResources(behaviorMappings.Where(x => x.Module == null).ToList()) }; if (_configuration.MergeSpecificationPath.IsNotEmpty()) { specification = _mergeService.Merge(specification, _configuration.MergeSpecificationPath); } return(specification); }