public static Dictionary <string, DealHeader> GetJsonObject(this DealHeader thdr, IDictionary <string, object> _bag)
        {
            Dictionary <string, DealHeader> result = new Dictionary <string, DealHeader>();
            IDictionary <string, object>    bags   = _bag;

            foreach (KeyValuePair <string, object> bag in bags)
            {
                object inst = new object();
                IEnumerable <PropertyInfo> map = JsonParser.PrepareInstance(out inst, typeof(DealHeader));
                JsonParser.DeserializeType(map, (IDictionary <string, object>)bag.Value, inst);
                DealHeader deck = (DealHeader)inst;
                result.Add(bag.Key, deck);
            }
            return(result);
        }
예제 #2
0
        public static Dictionary <string, DealMessage> GetJsonObject(this DealMessage tmsg, string JsonString)
        {
            Dictionary <string, DealMessage> result = new Dictionary <string, DealMessage>();
            Dictionary <string, object>      bags   = new Dictionary <string, object>();

            tmsg.GetJsonBag(JsonString, bags);

            foreach (KeyValuePair <string, object> bag in bags)
            {
                object inst = new object();
                IEnumerable <PropertyInfo> map = JsonParser.PrepareInstance(out inst, typeof(DealMessage));
                JsonParser.DeserializeType(map, (IDictionary <string, object>)bag.Value, inst);
                DealMessage deck = (DealMessage)inst;
                result.Add(bag.Key, deck);
            }
            return(result);
        }