diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentCacheDataSerializationResult.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentCacheDataSerializationResult.cs index 7cd388d712..cde39eaa3c 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentCacheDataSerializationResult.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentCacheDataSerializationResult.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; namespace Umbraco.Web.PublishedCache.NuCache.DataSource { + /// + /// The serialization result from for which the serialized value + /// will be either a string or a byte[] + /// public struct ContentCacheDataSerializationResult : IEquatable { public ContentCacheDataSerializationResult(string stringData, byte[] byteData) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IContentCacheDataSerializer.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IContentCacheDataSerializer.cs index 87ac5af91e..f628c8981b 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IContentCacheDataSerializer.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IContentCacheDataSerializer.cs @@ -11,7 +11,21 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource /// public interface IContentCacheDataSerializer { + /// + /// Deserialize the data into a + /// + /// + /// + /// + /// ContentCacheDataModel Deserialize(int contentTypeId, string stringData, byte[] byteData); + + /// + /// Serializes the + /// + /// + /// + /// ContentCacheDataSerializationResult Serialize(int contentTypeId, ContentCacheDataModel model); } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/JsonContentNestedDataSerializer.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/JsonContentNestedDataSerializer.cs index 2fa892a5e6..47f07b8b1d 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/JsonContentNestedDataSerializer.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/JsonContentNestedDataSerializer.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { public ContentCacheDataModel Deserialize(int contentTypeId, string stringData, byte[] byteData) { - if (byteData != null) + if (stringData == null && byteData != null) throw new NotSupportedException($"{typeof(JsonContentNestedDataSerializer)} does not support byte[] serialization"); // by default JsonConvert will deserialize our numeric values as Int64