static async Task SendOrderMessages() { var orders = CreateTestOrders(); var sender = new TopicSender(ServiceBusConnectionString, OrdersTopicPath); foreach (var order in orders) { await sender.SendOrderMessage(order); } // Always be a good Service Bus citizan... await sender.Close(); }
static async Task SendOrderMessages() { var orders = CreateTestOrders(); //use TopicClient(connectstring and name of topic) var sender = new TopicSender(ServiceBusConnectionString, OrdersTopicPath); foreach (var order in orders) { await sender.SendOrderMessage(order); } // Always Close... await sender.Close(); }