diff --git a/ICD.Common.Utils/Extensions/JsonReaderExtensions.cs b/ICD.Common.Utils/Extensions/JsonReaderExtensions.cs index 0ef7078..5c4a023 100644 --- a/ICD.Common.Utils/Extensions/JsonReaderExtensions.cs +++ b/ICD.Common.Utils/Extensions/JsonReaderExtensions.cs @@ -190,6 +190,21 @@ namespace ICD.Common.Utils.Extensions return (T)(object)extends.GetValueAsInt(); } + /// + /// Gets the current value as a guid. + /// + /// + /// + [PublicAPI] + public static Guid GetValueAsGuid(this JsonReader extends) + { + if (extends == null) + throw new ArgumentNullException("extends"); + + string stringValue = extends.GetValueAsString(); + return new Guid(stringValue); + } + /// /// Deserializes an array of items from the reader's current value. ///