protected virtual void FillModules( List <AbpModuleDescriptor> modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) { //All modules starting from the startup module foreach (var moduleType in AbpModuleHelper.FindAllModuleTypes(startupModuleType)) { modules.Add(CreateModuleDescriptor(services, moduleType)); } var allModules = plugInSources.SelectMany(pluginSource => pluginSource.GetModulesWithAllDependencies()) .Distinct() .ToArray(); //Plugin modules foreach (var moduleType in allModules) { if (modules.Any(m => m.Type == moduleType)) { continue; } modules.Add(CreateModuleDescriptor(services, moduleType, isLoadedAsPlugIn: true)); } }
protected virtual void SetDependencies(List <AbpModuleDescriptor> modules, AbpModuleDescriptor module) { foreach (var dependedModuleType in AbpModuleHelper.FindDependedModuleTypes(module.Type)) { var dependedModule = modules.FirstOrDefault(m => m.Type == dependedModuleType); if (dependedModule == null) { throw new AbpException("Could not find a depended module " + dependedModuleType.AssemblyQualifiedName + " for " + module.Type.AssemblyQualifiedName); } module.AddDependency(dependedModule); } }