Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,SegundoNombre,Apellido")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Create([Bind("Id,Modelo,Precio")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producto));
        }