Example #1
0
        public override async Task <string> Reduce(IAction action)
        {
            string stateString = string.Empty;

            try
            {
                BarAddPayload payload = JsonConvert.DeserializeObject <BarAddPayload>(action.Payload);

                await BarObject.Save(payload.Symbol, payload.Bar);
            }
            catch (Exception e)
            {
                Debug.WriteLine($"Error: {e.Message}");

                Debugger.Break();
            }

            return(stateString);
        }
Example #2
0
 public BarAddAction(BarAddPayload payload) :
     base("Bar.Add", JsonConvert.SerializeObject(payload))
 {
 }