Esempio n. 1
0
        private void CleanupWebSites(AzureResourceType type, Dictionary <string, object> resources)
        {
            SafeExecute(() =>
            {
                var manager = new AzureWebSiteManager();
                foreach (var obj in resources.Values)
                {
                    var site = obj as WAML.WebSites.Models.WebSite;
                    if (site == null)
                    {
                        throw new Exception(string.Format("Incorrect resource was stored in '{0}' collection", type));
                    }

                    if (manager.WebSiteExists(site.Name))
                    {
                        manager.DeleteWebSite(site.Name);
                    }
                }

                resources.Clear();
            }, type.ToString());
        }
        private void CleanupWebSites(AzureResourceType type, Dictionary<string, object> resources)
        {
            SafeExecute(() =>
                {
                    var manager = new AzureWebSiteManager();
                    foreach (var obj in resources.Values)
                    {
                        var site = obj as WAML.WebSites.Models.WebSite;
                        if (site == null)
                        {
                            throw new Exception(string.Format("Incorrect resource was stored in '{0}' collection", type));
                        }

                        if(manager.WebSiteExists(site.Name))
                        {
                            manager.DeleteWebSite(site.Name);
                        }
                    }

                    resources.Clear();
                }, type.ToString());
        }