예제 #1
0
        public IDictionary<string, object> ApplyEvent(IDictionary<string, object> root, ModelEvent modelEvent)
        {
            var model = FetchModel(root, modelEvent.route);

            if (modelEvent.payload == null)
            {
                return null;
            }

            if (modelEvent.payload.values != null)
            {
                model.Merge(modelEvent.payload.values);
            }

            if (modelEvent.payload.delete != null)
            {
                model.DeleteByKeys(modelEvent.payload.delete);
            }

            return model;
        }
 public AddEventCommand(ModelEvent modelEvent)
 {
     this.modelEvent = modelEvent;
 }
예제 #3
0
        public IDictionary <string, object> ApplyEvent(IDictionary <string, object> root, ModelEvent modelEvent)
        {
            var model = FetchModel(root, modelEvent.route);

            if (modelEvent.payload == null)
            {
                return(null);
            }

            if (modelEvent.payload.values != null)
            {
                model.Merge(modelEvent.payload.values);
            }

            if (modelEvent.payload.delete != null)
            {
                model.DeleteByKeys(modelEvent.payload.delete);
            }

            return(model);
        }