Ejemplo n.º 1
0
        protected ApplicationBase(Type appEntryModuleType, IServiceCollection services, Action <ApplicationCreationOptions> optionsAction)
        {
            appEntryModuleType.CheckNotNull(nameof(appEntryModuleType));
            appEntryModuleType.CheckEntryModuleType();
            services.CheckNotNull(nameof(services));

            EntryModuleType = appEntryModuleType;
            Services        = services;
            var options = new ApplicationCreationOptions(services);

            optionsAction?.Invoke(options);
            services.AddSingleton <IApplication>(this);
            services.AddSingleton <IModuleContainer>(this);
            services.AddCoreServices();
            services.AddCoreFraServices(this, options);
            Modules = LoadModules(services, options);
            ConfigureServices();
        }
Ejemplo n.º 2
0
 protected virtual IReadOnlyCollection <AppModuleDescriptor> LoadModules(IServiceCollection services, ApplicationCreationOptions options)
 {
     return(services.GetSingleInstance <ModuleLoader>().LoadModules(services, EntryModuleType));
 }