I have been trying to publish events to an Azure EventGrid using Azure.Messaging.EventGridEvent.EventGridPublisherClient and it works out just fine. I just discovered that there is another client for EventGrid, namely Microsoft.Azure.EventGrid.EventGridClient.
Upon investigation, both libraries and namespaces achieve the same thing, but expose vastly different methods and properties, and handle serialization and deserialization of Data very differently; while Microsoft.Azure.EventGrid.EventGridEvent directly exposes the Data property as a public property, Azure.Messaging.EventGridEvent has Data as an internal property and only exposes methods like GetData<T>, and GetDataAsync<T>.
Having two libraries do almost similar things has left me totally confused as to which one is the right library to use. Are there any guidelines as to when should we use one library over the other? Are there any benefits to using one over the other? I tried looking into the documentation but couldn't discern any information about the correct usage of either of these libraries.