Example #1
0
        private void CleanupStorageServices(AzureResourceType type, Dictionary <string, object> resources)
        {
            SafeExecute(() =>
            {
                var manager = new AzureStorageServiceManager();
                foreach (var obj in resources.Values)
                {
                    var service = obj as string;

                    if (service == null)
                    {
                        throw new Exception(string.Format("Incorrect resource was stored in '{0}' collection", type));
                    }

                    if (manager.GetStorageService(service) != null)
                    {
                        manager.DeleteStorageService(service);
                    }
                }

                resources.Clear();
            }, type.ToString());
        }
        private void CleanupStorageServices(AzureResourceType type, Dictionary<string, object> resources)
        {
            SafeExecute(() =>
                {
                    var manager = new AzureStorageServiceManager();
                    foreach (var obj in resources.Values)
                    {
                        var service = obj as string;

                        if (service == null)
                        {
                            throw new Exception(string.Format("Incorrect resource was stored in '{0}' collection", type));
                        }

                        if (manager.GetStorageService(service) != null)
                        {
                            manager.DeleteStorageService(service);
                        }
                    }

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