示例#1
0
        public static Dictionary <string, CoinsReward> MapFromJson(Dictionary <string, object> jsonMap)
        {
            Dictionary <string, CoinsReward> result = new Dictionary <string, CoinsReward>();

            foreach (var entry in jsonMap)
            {
                CoinsReward value = CreateFromDictionary(entry.Value as Dictionary <string, object>);
                result.Add(entry.Key, value);
            }
            return(result);
        }
示例#2
0
        public static CoinsReward CreateFromDictionary(Dictionary <string, object> jsonMap)
        {
            try
            {
                if (jsonMap == null)
                {
                    return(null);
                }

                var request = new CoinsReward();


                if (jsonMap.ContainsKey("amount"))
                {
                    request.Amount = System.Convert.ToInt32(jsonMap["amount"]);
                }

                return(request);
            }
            catch (System.ApplicationException ex)
            {
                throw new AmazonException("Error encountered while creating Object from dicionary", ex);
            }
        }