Interface ILambdaJsonSerializer
The ILambdaILambdaSerializer
interface by adding
the ability to deserialize a JSON document to an explicitly specified type instead of relying on a
generic type parameter.
Namespace: LambdaSharp.Serialization
Assembly: LambdaSharp.dll
Syntax
public interface ILambdaJsonSerializer : ILambdaSerializer
Methods
Deserialize(Stream, Type)
The Deserialize(Stream, Type) method deserializes the JSON object from a Stream
.
Declaration
object Deserialize(Stream stream, Type type)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | Stream to deserialize. |
System. |
type | The type to instantiate. |
Returns
Type | Description |
---|---|
System. |
Deserialized instance. |
Deserialize(String, Type)
The Deserialize(String, Type) method deserializes the JSON object from a string
.
Declaration
virtual object Deserialize(string json, Type type)
Parameters
Type | Name | Description |
---|---|---|
System. |
json | String to deserialize. |
System. |
type | The type to instantiate. |
Returns
Type | Description |
---|---|
System. |
Deserialized instance. |
Deserialize<T>(String)
The Deserialize<T>(String) method deserializes the JSON object from a string
.
Declaration
virtual T Deserialize<T>(string json)
Parameters
Type | Name | Description |
---|---|---|
System. |
json | The |
Returns
Type | Description |
---|---|
T | Deserialized instance. |
Type Parameters
Name | Description |
---|---|
T | The deserialization target type. |
Serialize<T>(T)
The Serialize<T>(T) interface method serializes
an instance to a JSON string
.
Declaration
virtual string Serialize<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The instance to serialize. |
Returns
Type | Description |
---|---|
System. |
Serialized JSON |
Type Parameters
Name | Description |
---|---|
T |