public async Task <IActionResult> Create(Bebida bebida)
        {
            if (ModelState.IsValid)
            {
                _contexto.Add(bebida);
                await _contexto.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bebida));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,Nome")] Prato prato)
        {
            if (ModelState.IsValid)
            {
                _context.Add(prato);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(prato));
        }
Example #3
0
 public async Task InsertAsync(Prato obj)
 {
     _contexto.Add(obj);
     await _contexto.SaveChangesAsync();
 }
Example #4
0
 public async Task InsertAsync(Pedido obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }