Esempio n. 1
0
        public async Task <IActionResult> TwitchStream([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "twitch/streamupdate/{userId}/{accountId}")] HttpRequest req, int userId, string accountId,
                                                       ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");
            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            var    data        = JsonConvert.DeserializeObject <TwitchStreamUpdateResponse>(requestBody);
            var    commandData = _twitchService.HandleTwitchStreamUpdateWebhook(data, userId, accountId);
            var    result      = await _mediator.Send(commandData);

            return(new OkObjectResult(result));
        }