public async Task <IActionResult> Create(Routine routine) { if (ModelState.IsValid) { await _routineService.AddRoutine(routine); } return(RedirectToAction(nameof(Index))); }
public bool AddRoutines(string name, Action <object[]> function, params object[] args) { _logger.LogDebug($"Adding Routine {name} params count {args.Length} - delegate params count {function.Method.GetParameters().Length}"); return(_routineService.AddRoutine(name, () => { // if (args.Length > 0) //function.Method.Invoke(function.Target, args); // else function.Invoke(args); })); }
public IActionResult AddRoutine(NewRoutineVm newRoutineVm) { var id = _routineService.AddRoutine(newRoutineVm); return(RedirectToAction("Index")); }
public bool AddRoutines(string name, LuaFunction function, params object[] args) { return(_routineService.AddRoutine(name, () => { function.Call(args); })); }