/// <summary> /// The SetJsonBag. /// </summary> /// <param name="thdr">The thdr<see cref="DealHeader"/>.</param> /// <returns>The <see cref="IDictionary{string, object}"/>.</returns> public static IDictionary <string, object> SetJsonBag(this DealHeader thdr) { return(new Dictionary <string, object>() { { "DealHeader", JsonParserProperties.GetJsonProperties(typeof(DealHeader), thdr.Context.Complexity) .Select(k => new KeyValuePair <string, object>(k.Name, k.GetValue(thdr, null))) .ToDictionary(k => k.Key, v => v.Value) } }); }
/// <summary> /// The SetJsonBag. /// </summary> /// <param name="tmsg">The tmsg<see cref="DealMessage"/>.</param> /// <returns>The <see cref="Dictionary{string, object}"/>.</returns> public static Dictionary <string, object> SetJsonBag(this DealMessage tmsg) { return(new Dictionary <string, object>() { { "DealMessage", JsonParserProperties.GetJsonProperties(typeof(DealMessage)) .Select(k => new KeyValuePair <string, object>(k.Name, k.GetValue(tmsg, null))) .ToDictionary(k => k.Key, v => v.Value) } }); }