예제 #1
0
    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));
        }
    }
예제 #2
0
        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());
        }