Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Last active November 13, 2020 07:50
Show Gist options
  • Save PradeepLoganathan/6551ed7037db8b9dba87accff7834dc4 to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/6551ed7037db8b9dba87accff7834dc4 to your computer and use it in GitHub Desktop.
public async Task DeleteCustomer(Customer customer)
{
try
{
await this._cosmosDbContext.CustomerContainer.DeleteItemAsync<Customer>(customer.customerId, new PartitionKey(customer.customerId) );
}
catch (CosmosException ex)
{
Console.WriteLine("Exception occured in DeleteCustomer: Message body is {0}.\n", ex.Message);
throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment