예제 #1
0
        public void ConfigServices(ModuleConfigServiceContext context)
        {
            var services = context.Services;

            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            _logger.LogInformation("MiCake:ActivateServices...");

            for (int index = 0; index < configServicesLifetimes.Count; index++)
            {
                var des = configServiceDes[index];
                foreach (var miCakeModule in _modules)
                {
                    _moduleLogger.LogModuleInfo(miCakeModule, $"MiCake {des}: ");
                    configServicesLifetimes[index](miCakeModule.Instance, context);
                }
            }
            _configServiceActions?.Invoke(context);

            _logger.LogInformation("MiCake:ActivateServices Completed.....");
        }
예제 #2
0
 private void StartModuleLifetime(
     IMiCakeModuleCollection modules,
     IEnumerable <ModuleBootInfo> lifetimes,
     object contextInfo)
 {
     foreach (var lifetimeInfo in lifetimes)
     {
         foreach (var module in modules)
         {
             //logging current module info.
             _moduleLogger.LogModuleInfo(module, $"MiCake {lifetimeInfo.Description}: ");
             //execute current module lifetime.
             lifetimeInfo.StartAction(module.Instance, contextInfo);
         }
     }
 }