In version 2.0.3 (maybe even in releases before) the studio is calling the following http endpoint in order to delete a database:
/admin/databases/nameOfYourDatabase?hard-delete=true
?hard-delete=true is optional.
Based on the source code from the studio I have created this function:
public void DeleteDatabase(string name, bool hardDelete = false)
{
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException("name");
var databaseCommands = _documentStore.DatabaseCommands;
var relativeUrl = "/admin/databases/" + name;
if (hardDelete)
relativeUrl += "?hard-delete=true";
var serverClient = databaseCommands.ForSystemDatabase() as ServerClient;
if (serverClient == null)
throw new ApplicationException("Please use a more intelligent exception here");
var httpJsonRequest = serverClient.CreateRequest("DELETE", relativeUrl);
httpJsonRequest.ExecuteRequest();
}