internal AcwApplicationBase( [NotNull] Type startupModuleType, [NotNull] IServiceCollection services, [CanBeNull] Action <AcwApplicationCreationOptions> optionsAction) { Check.NotNull(startupModuleType, nameof(startupModuleType)); Check.NotNull(services, nameof(services)); StartupModuleType = startupModuleType; Services = services; services.TryAddObjectAccessor <IServiceProvider>(); var options = new AcwApplicationCreationOptions(services); optionsAction?.Invoke(options); services.AddSingleton <IAcwApplication>(this); services.AddSingleton <IModuleContainer>(this); services.AddCoreServices(); services.AddCoreAcwServices(this); Modules = LoadModules(services, options); }
protected virtual void SetAcwApplicationCreationOptions(AcwApplicationCreationOptions options) { }
private IReadOnlyList <IAcwModuleDescriptor> LoadModules(IServiceCollection services, AcwApplicationCreationOptions options) { return(services .GetSingletonInstance <IModuleLoader>() .LoadModules( services, StartupModuleType, options.PlugInSources )); }