mirror of
https://github.com/AndrioCelos/TableturfBattleApp.git
synced 2026-04-18 14:47:24 -05:00
11 lines
482 B
C#
11 lines
482 B
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
namespace TableturfBattleServer;
|
|
internal class JsonUtils {
|
|
private static readonly JsonSerializerSettings serializerSettings = new() { ContractResolver = new CamelCasePropertyNamesContractResolver() };
|
|
|
|
internal static string Serialise(object? o) => JsonConvert.SerializeObject(o, serializerSettings);
|
|
internal static T? Deserialise<T>(string json) => JsonConvert.DeserializeObject<T>(json, serializerSettings);
|
|
}
|