コード例 #1
0
        public async Task <IActionResult> OnPost()
        {
            carroRepository.Atualizar(Carro);
            await carroRepository.Commit();

            return(RedirectToPage("Index"));
        }
コード例 #2
0
 public IActionResult OnPost()
 {
     if (ModelState.IsValid)
     {
         carroRepository.Adicionar(Carro);
         carroRepository.Commit();
         return(RedirectToPage("Index"));
     }
     else
     {
         return(Page());
     }
 }
コード例 #3
0
 public IActionResult OnPostExcluir(int id)
 {
     carroRepository.Excluir(id);
     carroRepository.Commit();
     return(RedirectToPage("Index"));
 }