Exemplo n.º 1
0
 public async Task <IActionResult> Create(Routine routine)
 {
     if (ModelState.IsValid)
     {
         await _routineService.AddRoutine(routine);
     }
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 2
0
 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);
     }));
 }
Exemplo n.º 3
0
        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); }));
 }