Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
 public async Task <IActionResult> Post([FromBody] ExampleViewModel model) => Ok(await _repo.InsertExampleAsync(model, User.FindFirst("uid")?.Value).ConfigureAwait(false));