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