Пример #1
0
        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());
            }
        }
Пример #2
0
 public async Task <IActionResult> Put(int Id, [FromBody] ExampleViewModel model) => Ok(await _repo.UpdateExampleAsync(Id, model, User.FindFirst("uid")?.Value).ConfigureAwait(false));