summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/OpenId/Realm.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/Realm.cs')
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Realm.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Realm.cs b/src/DotNetOpenAuth.OpenId/OpenId/Realm.cs
index 98e3598..0b4205b 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Realm.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Realm.cs
@@ -18,6 +18,7 @@ namespace DotNetOpenAuth.OpenId {
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Xrds;
using DotNetOpenAuth.Yadis;
+ using DotNetOpenAuth.Messaging.Reflection;
/// <summary>
/// A trust root to validate requests and match return URLs against.
@@ -58,6 +59,17 @@ namespace DotNetOpenAuth.OpenId {
private Uri uri;
/// <summary>
+ /// Initializes the <see cref="Realm"/> class.
+ /// </summary>
+ static Realm() {
+ Func<string, Realm> safeRealm = str => {
+ Contract.Assume(str != null);
+ return new Realm(str);
+ };
+ MessagePart.Map<Realm>(realm => realm.ToString(), realm => realm.OriginalString, safeRealm);
+ }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="Realm"/> class.
/// </summary>
/// <param name="realmUrl">The realm URL to use in the new instance.</param>