//----------------------------------------------------------------------- // // Copyright (c) Microsoft. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.AspNet.Clients { using System; using System.IO; using System.Runtime.Serialization.Json; /// /// The json helper. /// internal static class JsonHelper { #region Public Methods and Operators /// /// The deserialize. /// /// /// The stream. /// /// The type of the value to deserialize. /// /// The deserialized value. /// public static T Deserialize(Stream stream) where T : class { Requires.NotNull(stream, "stream"); var serializer = new DataContractJsonSerializer(typeof(T)); return (T)serializer.ReadObject(stream); } #endregion } }