in quickstarts/microsoft.customproviders/custom-rp-with-function/src/HttpTrigger1/run.csx [208:221]
public static async Task<HttpResponseMessage> RemoveCustomResource(HttpRequestMessage requestMessage, CloudTable tableStorage, string partitionKey, string rowKey)
{
// Attempt to retrieve the Existing Stored Value
var tableQuery = TableOperation.Retrieve<CustomResource>(partitionKey, rowKey);
var existingCustomResource = (CustomResource)(await tableStorage.ExecuteAsync(tableQuery)).Result;
if (existingCustomResource != null) {
var deleteOperation = TableOperation.Delete(existingCustomResource);
await tableStorage.ExecuteAsync(deleteOperation);
}
return requestMessage.CreateResponse(
existingCustomResource != null ? HttpStatusCode.OK : HttpStatusCode.NoContent);
}