Skip to content

Instantly share code, notes, and snippets.

private static EventData ToEventData(Guid eventId, object @event, IDictionary<string, object> headers = null)
{
if (headers == null) headers = new Dictionary<string, object>();
var serializerSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.None };
var data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(@event, serializerSettings));
var eventHeaders = new Dictionary<string, object>(headers)
{
{