Skip to content

Commit 9ba3003

Browse files
committed
code syntax
1 parent ec0324e commit 9ba3003

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

articles/event-hubs/event-hubs-availability-and-consistency.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ For use cases that require the maximum up time, this model is preferred.
4949
In some scenarios, the ordering of events can be important. For example, you may want your back-end system to process an update command before a delete command. In this instance, you can either set the partition key on an event, or use a `PartitionSender` object (if you are using the old Microsoft.Azure.Messaging library) to only send events to a certain partition. Doing so ensures that when these events are read from the partition, they are read in order. If you are using the **Azure.Messaging.EventHubs** library and for more information, see [Migrating code from PartitionSender to EventHubProducerClient for publishing events to a partition](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide.md#migrating-code-from-partitionsender-to-eventhubproducerclient-for-publishing-events-to-a-partition).
5050

5151
#### [Azure.Messaging.EventHubs (5.0.0 or later)](#tab/latest)
52+
53+
```csharp
5254
var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>";
5355
var eventHubName = "<< NAME OF THE EVENT HUB >>";
5456

@@ -61,7 +63,11 @@ await using (var producerClient = new EventHubProducerClient(connectionString, e
6163

6264
await producerClient.SendAsync(eventBatch);
6365
}
66+
```
67+
6468
#### [Microsoft.Azure.EventHubs (4.1.0 or earlier)](#tab/old)
69+
70+
```csharp
6571
var connectionString = "<< CONNECTION STRING FOR THE EVENT HUBS NAMESPACE >>";
6672
var eventHubName = "<< NAME OF THE EVENT HUB >>";
6773

@@ -81,6 +87,7 @@ finally
8187
await partitionSender.CloseAsync();
8288
await eventHubClient.CloseAsync();
8389
}
90+
```
8491

8592
---
8693

0 commit comments

Comments
 (0)