in quickstarts/microsoft.customproviders/custom-rp-with-function/src/HttpTrigger1/run.csx [153:166]
public static async Task<HttpResponseMessage> RetrieveCustomResource(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;
var retrieveResponse = requestMessage.CreateResponse(
existingCustomResource != null ? HttpStatusCode.OK : HttpStatusCode.NotFound);
retrieveResponse.Content = existingCustomResource != null ?
new StringContent(existingCustomResource.Data, System.Text.Encoding.UTF8, "application/json"):
null;
return retrieveResponse;
}