Skip to content

Commit 853e197

Browse files
committed
Pass content and options to GetPropertyValue method. (Jumoo/uSync.Complete.Issues#221)
1 parent fc03760 commit 853e197

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

uSync.Core/Serialization/Serializers/ContentSerializerBase.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ protected virtual XElement SerializeProperties(TObject item, SyncSerializerOptio
256256
validNode = true;
257257
}
258258

259-
if (validNode)
260-
{
261-
valueNode.Add(new XCData(GetExportValue(GetPropertyValue(value), property.PropertyType, value.Culture, value.Segment)));
262-
elements.Add(valueNode);
263-
}
259+
if (validNode)
260+
{
261+
valueNode.Add(new XCData(GetExportValue(GetPropertyValue(item, value, options), property.PropertyType, value.Culture!, value.Segment!)));
262+
elements.Add(valueNode);
264263
}
264+
}
265265

266266

267267
if (includeDefaults)
@@ -303,9 +303,13 @@ protected virtual XElement SerializeProperties(TObject item, SyncSerializerOptio
303303
return node;
304304
}
305305

306-
// allows us to switch between published / edited easier.
307-
protected virtual object GetPropertyValue(IPropertyValue value)
308-
=> value.EditedValue;
306+
// allows us to switch between published / edited easier.
307+
protected virtual object GetPropertyValue(TObject content, IPropertyValue value, SyncSerializerOptions options)
308+
=> value.EditedValue;
309+
310+
[Obsolete("Use Get Property value with content and options, will be removed in v17")]
311+
protected virtual object GetPropertyValue(IPropertyValue value)
312+
=> value.EditedValue;
309313

310314
protected override SyncAttempt<TObject> CanDeserialize(XElement node, SyncSerializerOptions options)
311315
{

0 commit comments

Comments
 (0)