Exemple #1
0
        private ILifetimeScope LoadModules()
        {
            var loader = RootContainer.Resolve <IPackageLockLoader>();

            var modulesConfig = RootContainer.Resolve <IOptions <ModulesOptions> >().Value;
            var lockFile      = new FileInfo(Environment.ExpandEnvironmentVariables(modulesConfig.ModulesLockPath));

            if (lockFile.Exists)
            {
                PackagesLock packagesLock;
                try
                {
                    packagesLock = JsonConvert.DeserializeObject <PackagesLock>(File.ReadAllText(lockFile.FullName));
                }
                catch (Exception)
                {
                    return(RootContainer);
                }

                var loadContext = loader.Load(packagesLock).Result;
                if (loadContext.PackagesLoaded)
                {
                    return(RootContainer.BeginLifetimeScope(builder => loadContext.Configure(builder)));
                }
            }

            return(RootContainer);
        }
Exemple #2
0
 public GuestServiceBootstrapper()
 {
     ApplicationContainer = RootContainer.BeginLifetimeScope();
 }
Exemple #3
0
 public InProductTrainingServiceBootstrapper()
 {
     ApplicationContainer = RootContainer.BeginLifetimeScope();
 }