예제 #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);
        }
예제 #2
0
 public GuestServiceBootstrapper()
 {
     ApplicationContainer = RootContainer.BeginLifetimeScope();
 }
예제 #3
0
 public InProductTrainingServiceBootstrapper()
 {
     ApplicationContainer = RootContainer.BeginLifetimeScope();
 }