Merge branch 'v8/nucache-serializer' of https://github.com/nzdev/Umbraco-CMS into nzdev-v8/nucache-serializer

This commit is contained in:
Shannon
2020-07-03 00:52:40 +10:00
13 changed files with 88 additions and 28 deletions

View File

@@ -49,6 +49,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
private readonly IPublishedModelFactory _publishedModelFactory;
private readonly IDefaultCultureAccessor _defaultCultureAccessor;
private readonly UrlSegmentProviderCollection _urlSegmentProviders;
private readonly IContentNestedDataSerializer _contentNestedDataSerializer;
// volatile because we read it with no lock
private volatile bool _isReady;
@@ -82,7 +83,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
IDataSource dataSource, IGlobalSettings globalSettings,
IEntityXmlSerializer entitySerializer,
IPublishedModelFactory publishedModelFactory,
UrlSegmentProviderCollection urlSegmentProviders)
UrlSegmentProviderCollection urlSegmentProviders, IContentNestedDataSerializer contentNestedDataSerializer)
: base(publishedSnapshotAccessor, variationContextAccessor)
{
//if (Interlocked.Increment(ref _singletonCheck) > 1)
@@ -99,6 +100,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
_defaultCultureAccessor = defaultCultureAccessor;
_globalSettings = globalSettings;
_urlSegmentProviders = urlSegmentProviders;
_contentNestedDataSerializer = contentNestedDataSerializer;
// we need an Xml serializer here so that the member cache can support XPath,
// for members this is done by navigating the serialized-to-xml member
@@ -1458,7 +1460,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// note that numeric values (which are Int32) are serialized without their
// type (eg "value":1234) and JsonConvert by default deserializes them as Int64
Data = JsonConvert.SerializeObject(nestedData)
Data = _contentNestedDataSerializer.Serialize(nestedData)
};
//Core.Composing.Current.Logger.Debug<PublishedSnapshotService>(dto.Data);