diff --git a/src/Twilio.AspNet.Core/MinimalApiTwiMLResult.cs b/src/Twilio.AspNet.Core/MinimalApiTwiMLResult.cs index cd77532..e2ca0b9 100644 --- a/src/Twilio.AspNet.Core/MinimalApiTwiMLResult.cs +++ b/src/Twilio.AspNet.Core/MinimalApiTwiMLResult.cs @@ -1,6 +1,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Twilio.TwiML; // ReSharper disable once CheckNamespace namespace Twilio.AspNet.Core.MinimalApi; @@ -53,4 +54,20 @@ public Task ExecuteAsync(HttpContext httpContext) httpContext.Response.ContentLength = Encoding.UTF8.GetByteCount(twiML); return httpContext.Response.WriteAsync(twiML); } +} + +// ReSharper disable once InconsistentNaming +public static class TwiMLExtensions +{ + // ReSharper disable once InconsistentNaming + public static TwiMLResult ToTwiMLResult(this VoiceResponse voiceResponse) + { + return new TwiMLResult(voiceResponse); + } + + // ReSharper disable once InconsistentNaming + public static TwiMLResult ToTwiMLResult(this MessagingResponse messagingResponse) + { + return new TwiMLResult(messagingResponse); + } } \ No newline at end of file diff --git a/src/Twilio.AspNet.Core/TwiMLExtensions.cs b/src/Twilio.AspNet.Core/TwiMLExtensions.cs new file mode 100644 index 0000000..6189f2f --- /dev/null +++ b/src/Twilio.AspNet.Core/TwiMLExtensions.cs @@ -0,0 +1,20 @@ +using Twilio.TwiML; + +namespace Twilio.AspNet.Core +{ + // ReSharper disable once InconsistentNaming + public static class TwiMLExtensions + { + // ReSharper disable once InconsistentNaming + public static TwiMLResult ToTwiMLResult(this VoiceResponse voiceResponse) + { + return new TwiMLResult(voiceResponse); + } + + // ReSharper disable once InconsistentNaming + public static TwiMLResult ToTwiMLResult(this MessagingResponse messagingResponse) + { + return new TwiMLResult(messagingResponse); + } + } +} \ No newline at end of file