Interface IDataSerializer
Describes data serializer.
public interface IDataSerializer
Methods
AreObjectsEqual(object, object)
Compares two objects using json serialization.
bool AreObjectsEqual(object object1, object object2)
Parameters
Returns
FromJsonFile<T>(string)
Deserialize an object from a file containing JSON string.
T FromJsonFile<T>(string filePath) where T : class
Parameters
filePath
string
Returns
- T
Type Parameters
T
FromJsonStream<T>(Stream)
Deserialize an object from JSON data stream.
T FromJsonStream<T>(Stream stream) where T : class
Parameters
stream
Stream
Returns
- T
Type Parameters
T
FromJson<T>(string)
Deserialize an object from JSON string.
T FromJson<T>(string json) where T : class
Parameters
json
string
Returns
- T
Type Parameters
T
FromTomlFile<T>(string)
Deserialize an object from a file containing TOML string.
T FromTomlFile<T>(string filePath) where T : class
Parameters
filePath
string
Returns
- T
Type Parameters
T
FromToml<T>(string)
Deserialize an object from TOML string.
T FromToml<T>(string toml) where T : class
Parameters
toml
string
Returns
- T
Type Parameters
T
FromYamlFile<T>(string)
Deserialize an object from a file containing YAML string.
T FromYamlFile<T>(string filePath) where T : class
Parameters
filePath
string
Returns
- T
Type Parameters
T
FromYaml<T>(string)
Deserialize an object from YAML string.
T FromYaml<T>(string yaml) where T : class
Parameters
yaml
string
Returns
- T
Type Parameters
T
GetClone<T>(T)
Creates clone of an object using json serialization.
T GetClone<T>(T source) where T : class
Parameters
source
T
Returns
- T
Type Parameters
T
GetClone<T, U>(T)
Creates clone of an object using json serialization.
U GetClone<T, U>(T source) where T : class where U : class
Parameters
source
T
Returns
- U
Type Parameters
T
U
ToJson(object, bool)
Serialize an object to JSON string.
string ToJson(object obj, bool formatted = false)
Parameters
Returns
ToJsonStream(object, Stream, bool)
Serialize an object to JSON string written to a stream.
void ToJsonStream(object obj, Stream stream, bool formatted = false)
Parameters
ToYaml(object)
Serialize an object to YAML string.
string ToYaml(object obj)
Parameters
obj
object
Returns
TryFromJsonFile<T>(string, out T)
Tries to deserialize an object from JSON file.
bool TryFromJsonFile<T>(string filePath, out T content) where T : class
Parameters
filePath
stringcontent
T
Returns
Type Parameters
T
TryFromJsonFile<T>(string, out T, out Exception)
Tries to deserialize an object from JSON file.
bool TryFromJsonFile<T>(string filePath, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromJsonStream<T>(Stream, out T)
Tries to deserialize an object from JSON data stream.
bool TryFromJsonStream<T>(Stream stream, out T content) where T : class
Parameters
stream
Streamcontent
T
Returns
Type Parameters
T
TryFromJsonStream<T>(Stream, out T, out Exception)
Tries to deserialize an object from JSON data stream.
bool TryFromJsonStream<T>(Stream stream, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromJson<T>(string, out T)
Tries to deserialize an object from JSON string.
bool TryFromJson<T>(string json, out T content) where T : class
Parameters
json
stringcontent
T
Returns
Type Parameters
T
TryFromJson<T>(string, out T, out Exception)
Tries to deserialize an object from JSON string.
bool TryFromJson<T>(string json, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromTomlFile<T>(string, out T)
Tries to deserialize an object from TOML file.
bool TryFromTomlFile<T>(string filePath, out T content) where T : class
Parameters
filePath
stringcontent
T
Returns
Type Parameters
T
TryFromTomlFile<T>(string, out T, out Exception)
Tries to deserialize an object from TOML file.
bool TryFromTomlFile<T>(string filePath, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromToml<T>(string, out T)
Tries to deserialize an object from TOML string.
bool TryFromToml<T>(string toml, out T content) where T : class
Parameters
toml
stringcontent
T
Returns
Type Parameters
T
TryFromToml<T>(string, out T, out Exception)
Tries to deserialize an object from TOML string.
bool TryFromToml<T>(string toml, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromYamlFile<T>(string, out T)
Tries to serialize an object to YAML file.
bool TryFromYamlFile<T>(string filePath, out T content) where T : class
Parameters
filePath
stringcontent
T
Returns
Type Parameters
T
TryFromYamlFile<T>(string, out T, out Exception)
Tries to serialize an object to YAML file.
bool TryFromYamlFile<T>(string filePath, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T
TryFromYaml<T>(string, out T)
Tries to deserialize an object from YAML string.
bool TryFromYaml<T>(string yaml, out T content) where T : class
Parameters
yaml
stringcontent
T
Returns
Type Parameters
T
TryFromYaml<T>(string, out T, out Exception)
Tries to deserialize an object from YAML string.
bool TryFromYaml<T>(string yaml, out T content, out Exception error) where T : class
Parameters
Returns
Type Parameters
T