public async Task <ActionResult> Edit(int id, ExampleViewModel vm) { try { // TODO: Add update logic here await _repo.UpdateExampleAsync(id, vm, User.Identity.Name); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public async Task <IActionResult> Put(int Id, [FromBody] ExampleViewModel model) => Ok(await _repo.UpdateExampleAsync(Id, model, User.FindFirst("uid")?.Value).ConfigureAwait(false));