public static void Populate <T>(ReaderState reader, object obj) { var type = obj.GetType(); if (!typeof(T).IsAssignableFrom(type)) { throw new InvalidCastException($"'{type}' cannot be assigned to '{typeof(T)}'"); } Populate(obj, reader, SetterHandler.GetSetterHandlers(type)); }
private static IObjectReader CreateReader(Type type) => type == typeof(object) ? new DynamicObjectReader() : CreateReader(type, SetterHandler.GetActivatorAndSetterHandlers(type));