public void AddOrUpdate(Website website)
 {
     if (!_websites.Contains(website))
     {
         _websites.Add(website);
     }
 }
        private void StartWebsiteEndpoint(Website website)
        {
            var domainSetup = new AppDomainSetup()
                    {
                        ApplicationName = website.Name,
                        ApplicationBase = website.Path,
                        PrivateBinPath = Path.Combine(website.Path, "bin" ),
                        PrivateBinPathProbe = string.Empty,
                        ConfigurationFile = Path.Combine(website.Path, "Web.config")
                    };

            var evidence = AppDomain.CurrentDomain.Evidence;

            AppDomain appDomain = AppDomain.CreateDomain(
                website.Name,
                evidence,
                domainSetup);

            var websiteEndpoint = (WebsiteEndpoint)appDomain.CreateInstanceFromAndUnwrap(
                Assembly.GetExecutingAssembly().Location,
                typeof(WebsiteEndpoint).FullName);

            _websiteEndpoints.Add(websiteEndpoint);
            _appDomains.Add(appDomain);

            Logger.Debug("Starting Wcf endpoint for host {2} on path {1}", website.Path, website.HostName);
            websiteEndpoint.Start(website.HostName);
        }
Beispiel #3
0
 public void AddOrUpdate(Website website)
 {
     if (website.Id == 0)
     {
         _database.Websites.Add(website);
     }
     else
     {
         var websiteToUpdate = _database.Websites.Single(a => a.Id == website.Id);
         websiteToUpdate.HostName = website.HostName;
         websiteToUpdate.Name = website.Name;
         website.Path = website.Path;
     }
     _database.SaveChanges();
 }
 public void Remove(Website website)
 {
     _websites.Remove(website);
 }
Beispiel #5
0
 public void Remove(Website website)
 {
     _database.Websites.Remove(website);
     _database.SaveChanges();
 }