Condividi tramite


IDocumentClient.DeleteUserDefinedFunctionAsync Method

Definition

Overloads

DeleteUserDefinedFunctionAsync(String, RequestOptions)

Delete a UserDefinedFunction from the Azure Cosmos DB service as an asynchronous operation.

DeleteUserDefinedFunctionAsync(Uri, RequestOptions)

Delete a user defined function as an asynchronous operation in the Azure Cosmos DB service.

DeleteUserDefinedFunctionAsync(String, RequestOptions)

Delete a UserDefinedFunction from the Azure Cosmos DB service as an asynchronous operation.

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

Parameters

functionLink
String

The link of the UserDefinedFunction to delete. E.g. dbs/db_rid/colls/col_rid/udfs/udf_rid/

options
RequestOptions

(Optional) The request options for the request.

Returns

A System.Threading.Tasks containing a ResourceResponse<TResource> which will contain information about the request issued.

Exceptions

If functionLink is not set.

This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:

StatusCodeReason for exception
404NotFound - This means the resource you tried to delete did not exist.

Examples

//Delete a user defined function using its selfLink property.
//To get the functionLink you would have to query for the User Defined Function, using CreateUserDefinedFunctionQuery(),  and then refer to its .SelfLink property
await client.DeleteUserDefinedFunctionAsync(functionLink);

See also

Applies to

DeleteUserDefinedFunctionAsync(Uri, RequestOptions)

Delete a user defined function as an asynchronous operation in the Azure Cosmos DB service.

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

Parameters

functionUri
Uri

The URI of the user defined function to delete.

options
RequestOptions

(Optional) The RequestOptions for the request.

Returns

The task object representing the service response for the asynchronous operation.

Applies to