From 3de4a737c60b2c3beff518ae2a4f3bc8841102f2 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Mon, 1 Feb 2021 12:11:44 -0800 Subject: [PATCH 1/2] Fix sample --- .../samples/Sample3_ParseAndDeserializeEvents.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md index 3a2ebdcacd1e9..70d5bb8097e38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md @@ -52,8 +52,8 @@ foreach (CloudEvent cloudEvent in cloudEvents) } ``` -### Using `GetData()` -If expecting mostly system events, it may be cleaner to switch on object `GetData()` and use pattern matching to deserialize events. In the case where there are unrecognized event types, one can use the returned `BinaryData` to deserialize the custom event data. +### Using `AsSytemEventData()` +If expecting mostly system events, it may be cleaner to switch on `AsSytemEventData()` and use pattern matching to act on the individual events. In the case where there are unrecognized event types, one can use the returned `BinaryData` to examine the custom event data. ```C# Snippet:DeserializePayloadUsingAsSystemEventData foreach (EventGridEvent egEvent in egEvents) From a9e80cfa3f1fecd3c782245e6bef94ac619d7b10 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Mon, 1 Feb 2021 12:14:18 -0800 Subject: [PATCH 2/2] Fix --- .../samples/Sample3_ParseAndDeserializeEvents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md index 70d5bb8097e38..f64dcbe3d17bc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md @@ -53,7 +53,7 @@ foreach (CloudEvent cloudEvent in cloudEvents) ``` ### Using `AsSytemEventData()` -If expecting mostly system events, it may be cleaner to switch on `AsSytemEventData()` and use pattern matching to act on the individual events. In the case where there are unrecognized event types, one can use the returned `BinaryData` to examine the custom event data. +If expecting mostly system events, it may be cleaner to switch on `AsSytemEventData()` and use pattern matching to act on the individual events. In the case where there are unrecognized event types, one can use the returned `BinaryData` to examine the event data. ```C# Snippet:DeserializePayloadUsingAsSystemEventData foreach (EventGridEvent egEvent in egEvents)