Interface IJsonSerializer
Contract which defines the capabilities of a JSON serializer
Namespace: i5.Toolkit.Core.Utilities
Assembly: cs.temp.dll.dll
Syntax
public interface IJsonSerializer
Methods
FromJson<T>(String)
Deserializes an object from the given JSON string
Declaration
T FromJson<T>(string json)
Parameters
| Type | Name | Description |
|---|---|---|
| String | json | The json string with the data |
Returns
| Type | Description |
|---|---|
| T | Returns the deserialized type object |
Type Parameters
| Name | Description |
|---|---|
| T | The type which should be deserialized |
ToJson(Object, Boolean)
Serializes a given object to a JSON string
Declaration
string ToJson(object obj, bool prettyPrint = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object which should be serialized |
| Boolean | prettyPrint | If set to true, the JSON output will be formatted to a more easily readable form |
Returns
| Type | Description |
|---|---|
| String | Returns the serialized JSON string based on the object's values |