Example #1
0
        internal async Task RefreshData(IServiceControl serviceControl)
        {
            //TODO: Consider moving this into ServiceControl e.g. GetSageMessageBody or something, models should be just about data
            if (Data != null)
            {
                return;
            }

            var url        = string.Format("/messages/{0}/body", MessageId);
            var bodyString = await serviceControl.GetBody(url);

            if (bodyString != null)
            {
                if (IsXml(bodyString))
                {
                    Data = GetXmlData(bodyString.Replace("\\\"", "\"").Replace("\\r", "\r").Replace("\\n", "\n"));
                }
                else
                {
                    Data = JsonPropertiesHelper.ProcessValues(bodyString, CleanupBodyString);
                }
            }
            else
            {
                Data = new List <KeyValuePair <string, string> >();
            }
        }
Example #2
0
 public void OnStateAfterChangeChanged()
 {
     Values = JsonPropertiesHelper.ProcessValues(StateAfterChange, s => s.TrimStart('[').TrimEnd(']'))
              .Select(v => new SagaUpdatedValue
     {
         Name     = v.Key,
         NewValue = v.Value
     }).ToList();
 }