Newegg / newegg-marketplace-sdk-dotnet

Newegg Marketplace SDK .Net
7 stars 6 forks source link

About Deserialize “LimitQuantity” Error! #4

Open NeroLiang19 opened 3 years ago

NeroLiang19 commented 3 years ago

Hi Author,

I found a small bug!

        //public int? LimitQuantity { get; set; } error: Input string was not in a correct format.

        //Below is correct!
        [XmlElement("LimitQuantity"), JsonProperty("LimitQuantity")]
        public string _LimitQuantity { get; set; }
        [XmlIgnore, JsonIgnore]
        public int? LimitQuantity
        {
            get
            {
                if (string.IsNullOrEmpty(_LimitQuantity))
                    return null;
                return int.Parse(_LimitQuantity);
            }
            set { }
        }

Best regards!