private async Task <IActionResult> HandleCloudEvent(string jsonContent)
        {
            var details = JsonConvert.DeserializeObject <CloudEvent <dynamic> >(jsonContent);
            await CosmosHelper.CreateDocumentAsync("eventgriddata", "events", details);

            return(Ok());
        }
        private async Task <IActionResult> HandleGridEvents(string jsonContent)
        {
            var events = JArray.Parse(jsonContent);

            foreach (var e in events)
            {
                var details = JsonConvert.DeserializeObject <GridEvent <dynamic> >(e.ToString());
                await CosmosHelper.CreateDocumentAsync("eventgriddata", "events", details);
            }
            return(Ok());
        }
        private async Task <JsonResult> HandleValidation(string jsonContent)
        {
            var gridEvent = JsonConvert.DeserializeObject <List <GridEvent <Dictionary <string, string> > > >(jsonContent)
                            .First();
            await CosmosHelper.CreateDocumentAsync("eventgriddata", "events", gridEvent);

            // Retrieve the validation code and echo back.
            var validationCode = gridEvent.Data["validationCode"];

            return(new JsonResult(new
            {
                validationResponse = validationCode
            }));
        }