示例#1
0
        /// <summary>
        /// Parses a JSON string into the specified object type
        /// </summary>
        /// <param name="json">The JSON-encoded string you want to deserialize</param>
        /// <param name="type">The object type you want your json string deserialized into</param>
        /// <returns>Object of type Type</returns>
        public static object Deserialize(string json, Type type)
        {
            //Deserialize the json into a generic object
            object o = Deserialize(json);

            //Clear the Reflection caches
            PropertyCache.Clear();
            ConstructorCache.Clear();

            //Convert generic object to the specified Type
            return(Deserialize(o, type));
        }