Closed
Description
We could add extension methods to make the TwiML generation code more eloquent.
Consider this code:
app.MapPost("/submit", () =>
{
var voiceResponse = new VoiceResponse()
.Say($"You pressed 1. Good choice. Goodbye.");
return Results.Extensions.TwiML(voiceResponse);
});
Which could become:
app.MapPost("/submit", () =>
new VoiceResponse()
.Say($"You pressed 1. Good choice. Goodbye.")
.ToTwiMLResult()
);
with a convenient extension method.