Esempio n. 1
0
        // Primarily, for testing purposes only
        public void SetApplicationServiceProvider(IApplicationServiceProvider applicationServiceProvider)
        {
            if (applicationServiceProvider == null)
            {
                throw new ArgumentNullException(nameof(applicationServiceProvider));
            }

            _ApplicationServiceProvider = applicationServiceProvider;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes DI services that the node needs.
        /// </summary>
        /// <param name="serviceProvider">Provider of DI services.</param>
        /// <returns>Full node itself to allow fluent code.</returns>
        public Application Initialize(IApplicationServiceProvider serviceProvider)
        {
            Guard.NotNull(serviceProvider, nameof(serviceProvider));

            this.Services = serviceProvider;

            _logger = this.Services.ServiceProvider.GetRequiredService <ILogger <Application> >();

            _configuration = this.Services.ServiceProvider.GetService <IConfiguration>();
            _options       = this.Services.ServiceProvider.GetService <ApplicationOptions>();

            this.AsyncLoopFactory = this.Services.ServiceProvider.GetService <IAsyncLoopFactory>();

            this._logger.LogInformation($"Application initialized.");

            return(this);
        }
Esempio n. 3
0
        public MainApplicationContext Clone(IApplicationServiceProvider applicationServiceProvider = null)
        {
            var context = new MainApplicationContext(applicationServiceProvider ?? _ApplicationServiceProvider);

            context.ArgsOnly              = ArgsOnly;
            context.InitFile              = InitFile;
            context.CommodityPool         = CommodityPool;
            context.IsAtty                = IsAtty;
            context.TimesCommon           = TimesCommon;
            context.DefaultScope          = DefaultScope;
            context.EmptyScope            = EmptyScope;
            context.Logger                = Logger;
            context.IsVerifyEnabled       = IsVerifyEnabled;
            context.DefaultStyle          = DefaultStyle;
            context.DefaultStyleChanged   = DefaultStyleChanged;
            context.TimeZone              = TimeZone;
            context.ErrorContext          = ErrorContext;
            context.CancellationSignal    = CancellationSignal;
            context.DefaultPager          = DefaultPager;
            context._EnvironmentVariables = _EnvironmentVariables;
            return(context);
        }
Esempio n. 4
0
 public MainApplicationContext(IApplicationServiceProvider applicationServiceProvider = null)
 {
     _ApplicationServiceProvider = applicationServiceProvider ?? new ApplicationServiceProvider();
 }
Esempio n. 5
0
 public ProvidersController(IApplicationServiceProvider applicationServiceProvider)
 {
     _applicationServiceProvider = applicationServiceProvider;
 }
Esempio n. 6
0
 public PostCommitCommandRegistrar(IApplicationServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
Esempio n. 7
0
 public ProviderController(INotifier notifier,
                           IApplicationServiceProvider applicationServideProvider) : base(notifier)
 {
     _applicationServideProvider = applicationServideProvider;
 }
Esempio n. 8
0
 public AutoMapperTask(IEnumerable<Profile> profiles, IConfiguration configuration, IApplicationServiceProvider serviceContainer)
 {
     _configuration = configuration;
     _autoMapperProfiles = profiles;
     _container = serviceContainer;
 }
Esempio n. 9
0
 public AutoMapperTask(IEnumerable <Profile> profiles, IConfiguration configuration, IApplicationServiceProvider serviceContainer)
 {
     _configuration      = configuration;
     _autoMapperProfiles = profiles;
     _container          = serviceContainer;
 }