Attempts to preserve object references by writing an alias when value was previously
anchored, or by writing an anchor for the next value when it is seen for the first time.
public bool TryWriteReference(object? value)
The value to track.
true when an alias was written and no further output for this value is required.This method is intended for use by generated serializers and custom converters. It is a no-op unless ReferenceHandling is Preserve.