Skip to content

Commit 0fa8ec0

Browse files
committed
Pass content and options to GetPropertyValue method. (Jumoo/uSync.Complete.Issues#221)
1 parent b12bb9f commit 0fa8ec0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

uSync.Core/Serialization/Serializers/ContentSerializerBase.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ protected virtual async Task<XElement> SerializePropertiesAsync(TObject item, Sy
252252

253253
if (validNode)
254254
{
255-
valueNode.Add(new XCData(await GetExportValueAsync(GetPropertyValue(value), property.PropertyType, value.Culture!, value.Segment!)));
255+
valueNode.Add(new XCData(await GetExportValueAsync(GetPropertyValue(item, value, options), property.PropertyType, value.Culture!, value.Segment!)));
256256
elements.Add(valueNode);
257257
}
258258
}
@@ -298,6 +298,10 @@ protected virtual async Task<XElement> SerializePropertiesAsync(TObject item, Sy
298298
}
299299

300300
// allows us to switch between published / edited easier.
301+
protected virtual object? GetPropertyValue(TObject content, IPropertyValue value, SyncSerializerOptions options)
302+
=> value.EditedValue;
303+
304+
[Obsolete("Use Get Property value with content and options, will be removed in v17")]
301305
protected virtual object? GetPropertyValue(IPropertyValue value)
302306
=> value.EditedValue;
303307

0 commit comments

Comments
 (0)