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

            _ApplicationServiceProvider = applicationServiceProvider;
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #4
0
 public MainApplicationContext(IApplicationServiceProvider applicationServiceProvider = null)
 {
     _ApplicationServiceProvider = applicationServiceProvider ?? new ApplicationServiceProvider();
 }
Exemple #5
0
 public ProvidersController(IApplicationServiceProvider applicationServiceProvider)
 {
     _applicationServiceProvider = applicationServiceProvider;
 }
Exemple #6
0
 public PostCommitCommandRegistrar(IApplicationServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
 }
Exemple #7
0
 public ProviderController(INotifier notifier,
                           IApplicationServiceProvider applicationServideProvider) : base(notifier)
 {
     _applicationServideProvider = applicationServideProvider;
 }
 public AutoMapperTask(IEnumerable<Profile> profiles, IConfiguration configuration, IApplicationServiceProvider serviceContainer)
 {
     _configuration = configuration;
     _autoMapperProfiles = profiles;
     _container = serviceContainer;
 }
 public AutoMapperTask(IEnumerable <Profile> profiles, IConfiguration configuration, IApplicationServiceProvider serviceContainer)
 {
     _configuration      = configuration;
     _autoMapperProfiles = profiles;
     _container          = serviceContainer;
 }