protected virtual void FillModules( List <AbpModuleDescriptor> modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) { var logger = services.GetInitLogger <AbpApplicationBase>(); //All modules starting from the startup module foreach (var moduleType in AbpModuleHelper.FindAllModuleTypes(startupModuleType, logger)) { modules.Add(CreateModuleDescriptor(services, moduleType)); } //Plugin modules foreach (var moduleType in plugInSources.GetAllModules(logger)) { if (modules.Any(m => m.Type == moduleType)) { continue; } modules.Add(CreateModuleDescriptor(services, moduleType, isLoadedAsPlugIn: true)); } }
public static Type[] GetModulesWithAllDependencies([NotNull] this IPlugInSource plugInSource, ILogger logger) { Check.NotNull(plugInSource, nameof(plugInSource)); return(plugInSource .GetModules() .SelectMany(type => AbpModuleHelper.FindAllModuleTypes(type, logger)) .Distinct() .ToArray()); }