예제 #1
0
        public static object ReadObject <T>(ReaderState reader, object identifier)
        {
            if (reader.CustomObjectFactories == null || !reader.CustomObjectFactories.TryGetValue(typeof(T), out var customObjectCreator))
            {
                return(GetObjectReaderGeneric <T> .Reader.Read(reader));
            }

            var result = customObjectCreator.Create(identifier);

            ObjectReaders.Populate <T>(reader, result);
            return(result);
        }
예제 #2
0
 public static void Populate <T>(T obj, ReaderState reader) => ObjectReaders.Populate <T>(reader, obj);