示例#1
0
        public async Task <IActionResult> Create([Bind("ID,Nome,Preco")] Models.Console console)
        {
            if (ModelState.IsValid)
            {
                _context.Add(console);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(console));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("ID,Nome,Plataforma,Preco")] Jogo jogo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jogo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jogo));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("ID,Nome,CPF,RG,Email,Telefone")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
示例#4
0
 public void Insert(Pedido obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }