Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created October 20, 2020 05:00
Show Gist options
  • Select an option

  • Save PradeepLoganathan/1ad89b44de7adc7e92f98bb401e33085 to your computer and use it in GitHub Desktop.

Select an option

Save PradeepLoganathan/1ad89b44de7adc7e92f98bb401e33085 to your computer and use it in GitHub Desktop.
public async Task<Customer> GetCustomer(string customerId)
{
try
{
var customerResponse = await this._container.ReadItemAsync<Customer>(customerId, new PartitionKey(customerId));
return customerResponse;
}
catch (CosmosException ex)
{
Console.WriteLine("Exception occured in GetCustomer: {0} Message body is {1}.\n", ex.Message,ex.ResponseBody);
throw ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment