Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Created November 7, 2017 17:01
Show Gist options
  • Save jmarmolejos/8af77504c22368f903b2483f586ef10d to your computer and use it in GitHub Desktop.
Save jmarmolejos/8af77504c22368f903b2483f586ef10d to your computer and use it in GitHub Desktop.
public UpdateInventoryResponse UpdateInventoryProducts(UpdateInventoryProductsRequest updateRequest) {
var connectionString = "<your connectionstring that should not be stored like this>";
var queueName = "ProductUpdates";
var client = QueueClient.CreateFromConnectionString(connectionString, queueName);
var jsonContent = JsonConvert.SerializeObject(updateRequest);
var message = new BrokeredMessage(jsonContent);
client.Send(message)
return new UpdateInventoryResponse() { Success: True, Message: "Yay!" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment