When overridden in a derived class, converts the provided dictionary into an object of the specified type.
Syntax
CSharp
VisualBasic
ManagedCPlusPlus
JSharp
Parameters
- dictionary (IDictionary<(Of String, Object>))
An IDictionary instance of property data stored as name/value pairs.
- type (Type)
The Type of the resulting object.
- serializer (JavaScriptSerializer)
The JavaScriptSerializer instance.
Return Value
Return Value
The deserialized Object.
Notes For Inheritors
The Deserialize(IDictionary<(Of String, Object>), Type, JavaScriptSerializer) method iterates through the values in the dictionary parameter to construct an instance of the type requested in the type parameter. Although a converter can directly use values from dictionary, we recommend that the converter implementer use the ConvertToType<(Of T>)(Object) method instead. The converter should call this method on the JavaScriptSerializer instance available from the serializer parameter.
The ConvertToType<(Of T>)(Object) method allows the converter to pass in a property value from dictionary, and then return a value of the expected type. If a converter for a custom type is dealing with properties that themselves have registered converters (for example, type A has a property of type B, and type B is also associated with a custom converter), invoking ConvertToType<(Of T>)(Object) ensures that custom converters will be recursively invoked for property data that is contained in the dictionary. When the converter has successfully iterated through all entries in the dictionary, it returns a constructed instance of the target type.
If for some reason the converter encounters a problem during deserialization, it should throw an InvalidOperationException that describes the problem.
Assembly: System.Web.Extensions (Module: System.Web.Extensions)