Elastacloud.AzureManagement.Fluent.Clients.MobileServiceClient.Delete C# (CSharp) Method

Delete() public method

Deletes a mobile service along with any linked database server
public Delete ( bool deleteSqlAzureDatabase = true ) : void
deleteSqlAzureDatabase bool
return void
        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();
        }