public ActionResult Exec(IActionContext context) { try { ChainUtility.Run(this.Setup, context); ChainUtility.Run(this.Body, context); } finally { ChainUtility.Run(this.Teardown, context); } return(ActionResult.FromContext(context)); }
public ActionResult Exec(IActionContext context) { List <Dictionary <string, object> > res = new List <Dictionary <string, object> >(); for (int i = 0, val = Start; i < Count; i++, val += Step) { using (var newcontext = context.BeginContext()) { if (!string.IsNullOrEmpty(ItemName)) { newcontext.Vars[ItemName] = val; } ChainUtility.Run(this.Entry, newcontext); res.Add(context.GetContextValues()); } } return(new ActionResult(res)); }
public ActionResult Exec(IActionContext context) { List <Dictionary <string, object> > res = new List <Dictionary <string, object> >(); if (Source != null) { foreach (var item in Source) { using (var newcontext = context.BeginContext()) { if (!string.IsNullOrEmpty(ItemName)) { newcontext.Vars[ItemName] = item; } ChainUtility.Run(this.Entry, newcontext); res.Add(context.GetContextValues()); } } } return(new ActionResult(res)); }