Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Belczyk belczyk

View GitHub Profile
View gist:9196257
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)
{
{