示例#1
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
                                        JsonSerializer serializer)
        {
            var contract = serializer.ContractResolver.ResolveContract(objectType);

            return(ListConverterCache.GetList(contract, reader, serializer));
        }
示例#2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
                                        JsonSerializer serializer)
        {
            if (objectType.IsArray)
            {
                Type elementType = objectType.GetElementType();

                return(ListConverterCache.GetList(elementType, reader, serializer, true));
            }
            else
            {
                Type elementType = objectType.GetGenericArguments()[0];
                return(ListConverterCache.GetList(elementType, reader, serializer, false));
            }
        }