summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messaging/MessagingUtilities.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOAuth/Messaging/MessagingUtilities.cs')
-rw-r--r--src/DotNetOAuth/Messaging/MessagingUtilities.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/MessagingUtilities.cs b/src/DotNetOAuth/Messaging/MessagingUtilities.cs
index 7793276..5ec157c 100644
--- a/src/DotNetOAuth/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOAuth/Messaging/MessagingUtilities.cs
@@ -13,6 +13,7 @@ namespace DotNetOAuth.Messaging {
using System.Net;
using System.Text;
using System.Web;
+ using DotNetOAuth.Messaging.Reflection;
/// <summary>
/// A grab-bag of utility methods useful for the channel stack of the protocol.
@@ -139,6 +140,19 @@ namespace DotNetOAuth.Messaging {
return new MessageReceivingEndpoint(request.Url, request.HttpMethod == "GET" ? HttpDeliveryMethod.GetRequest : HttpDeliveryMethod.PostRequest);
}
+ internal static void AddExtraFields(this IProtocolMessage message, IDictionary<string, string> extraParameters) {
+ if (message == null) {
+ throw new ArgumentNullException("message");
+ }
+
+ if (extraParameters != null) {
+ MessageDictionary messageDictionary = new MessageDictionary(message);
+ foreach (var pair in extraParameters) {
+ messageDictionary.Add(pair);
+ }
+ }
+ }
+
/// <summary>
/// Converts a <see cref="NameValueCollection"/> to an IDictionary&lt;string, string&gt;.
/// </summary>