/// <summary>
        /// Deserializes a persisted <see cref="IMapsDirectlyToDatabaseTable"/> by resolving it as a reference and fetching the original
        /// object using <see cref="ShareManager.GetObjectFromPersistenceString"/>.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="objectType"></param>
        /// <param name="existingValue"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
            {
                return(null);
            }

            if (reader.TokenType != JsonToken.StartObject)
            {
                throw new JsonReaderException("Malformed json");
            }

            //instance to populate
            reader.Read();

            if (!reader.Value.Equals("PersistenceString"))
            {
                throw new JsonReaderException("Malformed json, expected single property PersistenceString");
            }

            //read the value
            reader.Read();
            var o = _shareManager.GetObjectFromPersistenceString((string)reader.Value);

            reader.Read();

            //read the end object
            if (reader.TokenType != JsonToken.EndObject)
            {
                throw new JsonReaderException("Did not find EndObject");
            }


            return(o);
        }