Serializer
- Namespace: Turian.Engine.Core
- Source File: Serializer.cs
AMOject serializer
Properties
JsonOptions
(JsonSerializerOptions) : Default options for (de)serializing Objects
Public Methods
ResetOptions
public static void ResetOptions()
Reset the default options for (de)serializing Objects when the UserCode is reloaded. Also re-scans loaded assemblies in TypeRegistry so newly compiled user types become resolvable by their stable TypeIdAttribute ids.
Load
public static T? Load(string absolutePath)
Load the Object content from the given path
Parameters:
absolutePath(string)
Returns: T?
LoadData
public static T? LoadData(string data)
Load the Object content from the given json
Parameters:
data(string)
Returns: T?
Save
public static void Save(string absolutePath, T value)
Save the Object content to the given path
Parameters:
absolutePath(string)value(T)
SaveAsync
public static async Task SaveAsync(string absolutePath, T value)
Saves the specified object to a file asynchronously.
Parameters:
absolutePath(string)value(T)
Returns: Task
Serialize
public static string Serialize(T value)
Serialize the Object content to a json string
Parameters:
value(T)
Returns: string