public override async Task InvokeAsync(IHttpFunctionContext context) { context.Logger.LogInformation("Appending events..."); using var reader = new StreamReader(context.Request.Body); var json = await reader.ReadToEndAsync(); var model = JsonConvert.DeserializeObject <AppendEvents>(json); if (model == null) { context.ActionResult = new BadRequestObjectResult("Invalid payload"); return; } await _streamService.AppendEventsAsync(model); context.ActionResult = new NoContentResult(); }