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, bool)
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 |
bool | 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 |