# EventHubMessage Constructors

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubmessage/)

## EventHubMessage(CachedMessage, Serializer) {#constructor-orleans-providers-streams-common-cachedmessage-orleans-serialization-ae38d1ad}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubmessage/constructors/constructor-orleans-providers-streams-common-cachedmessage-orleans-serialization-ae38d1ad/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubMessage.cs#L42-L53)

```csharp
public EventHubMessage(CachedMessage cachedMessage, Serializer serializer)
```

Duplicate of EventHub's EventData class.

### Parameters

- `cachedMessage` (`CachedMessage`)
- `serializer` (`Serializer`)

## EventHubMessage(StreamId, string, string, long, DateTime, DateTime, IDictionary&lt;string, object&gt;, byte[]) {#constructor-orleans-runtime-streamid-string-string-long-system-datetime-system-d-4043910f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubmessage/constructors/constructor-orleans-runtime-streamid-string-string-long-system-datetime-system-d-4043910f/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubMessage.cs#L26-L37)

```csharp
public EventHubMessage(StreamId streamId, string partitionKey, string offset, long sequenceNumber, DateTime enqueueTimeUtc, DateTime dequeueTimeUtc, IDictionary<string, object> properties, byte[] payload)
```

Constructor

### Parameters

- `streamId` (`StreamId`): Stream Identity
- `partitionKey` (`string`): EventHub partition key for message
- `offset` (`string`): Offset into the EventHub partition where this message was from
- `sequenceNumber` (`long`): Offset into the EventHub partition where this message was from
- `enqueueTimeUtc` (`DateTime`): Time in UTC when this message was injected by EventHub
- `dequeueTimeUtc` (`DateTime`): Time in UTC when this message was read from EventHub into the current service
- `properties` (`IDictionary<string, object>`): User properties from EventData object
- `payload` (`byte[]`): Binary data from EventData object
