Share via


DocumentClient.DeleteDatabaseAsync Methode

Definition

Überlädt

DeleteDatabaseAsync(String, RequestOptions)

Löschen Sie einen Database aus dem Azure Cosmos DB-Dienst als asynchronen Vorgang.

DeleteDatabaseAsync(Uri, RequestOptions)

Löschen Sie eine Datenbank als asynchronen Vorgang aus dem Azure Cosmos DB-Dienst.

DeleteDatabaseAsync(String, RequestOptions)

Löschen Sie einen Database aus dem Azure Cosmos DB-Dienst als asynchronen Vorgang.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>> DeleteDatabaseAsync (string databaseLink, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteDatabaseAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>>
override this.DeleteDatabaseAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>>
Public Function DeleteDatabaseAsync (databaseLink As String, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Database))

Parameter

databaseLink
String

Der Link des Database zu löschenden. z.B. dbs/db_rid/

options
RequestOptions

(Optional) Die Anforderungsoptionen für die Anforderung.

Gibt zurück

Eine System.Threading.Tasks , die eine ResourceResponse<TResource> enthält, die Informationen über die ausgestellte Anforderung enthält.

Implementiert

Ausnahmen

Wenn databaseLink nicht festgelegt ist.

Diese Ausnahme kann viele verschiedene Fehlertypen kapseln. Um den spezifischen Fehler zu ermitteln, sehen Sie sich immer die StatusCode-Eigenschaft an. Einige häufige Codes, die Sie beim Erstellen eines Dokuments erhalten, sind:

StatusCodeAusnahmegrund
404NotFound– Dies bedeutet, dass die Ressource, die Sie löschen möchten, nicht vorhanden war.

Beispiele

//Delete a database using its selfLink property
//To get the databaseLink you would have to query for the Database, using CreateDatabaseQuery(),  and then refer to its .SelfLink property
await client.DeleteDatabaseAsync(databaseLink);

Weitere Informationen

Gilt für:

DeleteDatabaseAsync(Uri, RequestOptions)

Löschen Sie eine Datenbank als asynchronen Vorgang aus dem Azure Cosmos DB-Dienst.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>> DeleteDatabaseAsync (Uri databaseUri, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteDatabaseAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>>
override this.DeleteDatabaseAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Database>>
Public Function DeleteDatabaseAsync (databaseUri As Uri, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Database))

Parameter

databaseUri
Uri

der URI der zu löschenden Datenbank.

options
RequestOptions

Die Anforderungsoptionen für die Anforderung.

Gibt zurück

Das Taskobjekt, das die Dienstantwort für den asynchronen Vorgang darstellt.

Implementiert

Gilt für: