Exemple #1
0
        public IActionResult Edit(Script script)
        {
            script.Author       = User?.Identity?.Name;
            script.LastModified = DateTime.Now;

            if (script.Id == null)
            {
                _service.Create(script);
            }
            else
            {
                _service.Update(script);
            }

            return(Redirect("/script"));
        }
Exemple #2
0
 public async Task <IActionResult> UpdateScript(ScriptDto script, CancellationToken cancellationToken)
 {
     return(Ok(await _service.Update(script, HttpContext.GetCurrentUserId(), cancellationToken)));
 }