Arcus.EventGrid package provides several ways to deserializing events.
Following paragraphs describe each supported way to deserialize an event.
We provide support for deserializing events to typed event objects where the custom event payload is available via the
If you want to have the original raw JSON event payload, you can get it via the
using Arcus.EventGrid;using Arcus.EventGrid.Parsers; // Parse from your custom event implementation with the `.Parse<>` function.EventGridMessage<NewCarRegistered> eventGridBatch = EventGridParser.Parse<NewCarRegistered>(rawEvent); // The event data type will be wrapped inside an `EventGridMessage<>` instance.NewCarRegistered eventGridMessage = eventGridBatch.Events.First(); // The original event payload can now be accessed.CarEventData eventPayload = eventGridMessage.Data;