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")); }
public async Task <IActionResult> CreateScript(ScriptDto script, CancellationToken cancellationToken) { var created = await _service.Create(script, HttpContext.GetCurrentUserId(), cancellationToken); return(Created(string.Empty, created)); }