DeleteDatabase() публичный Метод

Deletes a database and also deletes the server if the database is the last one
public DeleteDatabase ( string name, bool deleteServerIfLastDatabase = true ) : void
name string
deleteServerIfLastDatabase bool
Результат void
Пример #1
0
        /// <summary>
        /// Deletes a mobile service along with any linked database server
        /// </summary>
        public void Delete(bool deleteSqlAzureDatabase = true)
        {
            // when this succeeds ... we'll delete the db if this is still around
            // TODO: Add the delete database and server by extending the client
            if (deleteSqlAzureDatabase)
            {
                var client = new SqlDatabaseClient(SubscriptionId, ManagementCertificate, SqlAzureServerName)
                {
                    AdministratorServerLogin    = SqlAzureUsername,
                    AdministratorServerPassword = SqlAzurePassword,
                };
                client.DeleteDatabase(SqlAzureDbName, deleteSqlAzureDatabase);
            }
            // first we'll delete the mobile service
            var command = new DeleteMobileServiceCommand(MobileServiceName)
            {
                SubscriptionId = SubscriptionId,
                Certificate    = ManagementCertificate
            };

            command.Execute();
        }
 /// <summary>
 /// Deletes a mobile service along with any linked database server
 /// </summary>
 public void Delete(bool deleteSqlAzureDatabase = true)
 {
     // when this succeeds ... we'll delete the db if this is still around
     // TODO: Add the delete database and server by extending the client
     if (deleteSqlAzureDatabase)
     {
         var client = new SqlDatabaseClient(SubscriptionId, ManagementCertificate, SqlAzureServerName)
             {
                 AdministratorServerLogin = SqlAzureUsername,
                 AdministratorServerPassword = SqlAzurePassword,
             };
         client.DeleteDatabase(SqlAzureDbName, deleteSqlAzureDatabase);
     }
     // first we'll delete the mobile service
     var command = new DeleteMobileServiceCommand(MobileServiceName)
     {
         SubscriptionId = SubscriptionId,
         Certificate = ManagementCertificate
     };
     command.Execute();
 }