Esempio n. 1
0
        public void AddApplication(string name, string physicalPath, string applicationPoolName, Site site)
        {
            var path        = ApplicationUtils.ConvertNameToPath(name);
            var application = site.Applications.Add(path, physicalPath);

            application.ApplicationPoolName = applicationPoolName;
            _serverManager.CommitChanges();
        }
Esempio n. 2
0
        public void Handle(UpdateApplication command)
        {
            var site = _siteFacade.GetSite(command.SiteName);

            site.ThrowIfNull(command.SiteName);
            var applicationPool = _applicationPoolFacade.GetApplicationPool(command.ApplicationPoolName);

            applicationPool.ThrowIfNull(command.ApplicationPoolName);
            var application = _applicationFacade.GetApplication(command.ApplicationName, site);

            application.ThrowIfNull(command.ApplicationName);

            application.Path = ApplicationUtils.ConvertNameToPath(command.NewApplicationName);
            application.ApplicationPoolName = command.ApplicationPoolName;
            application.VirtualDirectories["/"].PhysicalPath = command.PhysicalPath;

            _applicationFacade.UpdateApplication();
        }