/// <summary> /// Serializes a <see cref="IMapsDirectlyToDatabaseTable"/> by sharing it with <see cref="ShareManager.GetObjectFromPersistenceString"/>. This /// creates a pointer only e.g. "Catalogue 123" and if an <see cref="ObjectExport"/> exists then also the <see cref="ObjectExport.SharingUID"/> /// so that the JSON can be used in other instances (that have imported the <see cref="ShareDefinition"/> of the serialized object) /// </summary> /// <param name="writer"></param> /// <param name="value"></param> /// <param name="serializer"></param> public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteNull(); return; } writer.WriteStartObject(); writer.WritePropertyName("PersistenceString"); writer.WriteRawValue('"' + _shareManager.GetPersistenceString((IMapsDirectlyToDatabaseTable)value) + '"'); writer.WriteEndObject(); }