public void Dispose()
 {
     if (_sqlManagementClient != null)
     {
         _sqlManagementClient.Dispose();
     }
 }
        public async Task <ServerListResponse> GetServers(string subscriptionId, string path)
        {
            using (SqlManagementClient client = new SqlManagementClient(getCredentials(subscriptionId, path)))
            {
                var servers = await client.Servers.ListAsync();

                client.Dispose();
                return(servers);
            }
        }
예제 #3
0
        /// <summary>
        /// Closes the session by disposing the clients
        /// </summary>
        /// <returns></returns>
        public bool CloseSession()
        {
            try
            {
                if (ResourceManagementClient != null)
                {
                    ResourceManagementClient.Dispose();
                }

                if (SqlManagementClient != null)
                {
                    SqlManagementClient.Dispose();
                }
                return(true);
            }
            catch (Exception)
            {
                //TODO: trace
                return(false);
            }
        }