diff --git a/ICD.Common.Utils/Json/JsonUtils.cs b/ICD.Common.Utils/Json/JsonUtils.cs index fede785..5c9b937 100644 --- a/ICD.Common.Utils/Json/JsonUtils.cs +++ b/ICD.Common.Utils/Json/JsonUtils.cs @@ -2,6 +2,7 @@ using System.Text; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; +using Newtonsoft.Json; namespace ICD.Common.Utils.Json { @@ -11,6 +12,17 @@ namespace ICD.Common.Utils.Json [PublicAPI] public static class JsonUtils { + /// + /// Forces Newtonsoft to cache the given type for faster subsequent usage. + /// + /// + public static void CacheType() + where T : new() + { + string serialized = JsonConvert.SerializeObject(ReflectionUtils.CreateInstance()); + JsonConvert.DeserializeObject(serialized); + } + /// /// Pretty-prints the JSON document. ///