Beispiel #1
0
        public async Task <ActionResult <LaMinka.Logica.Model.Cliente> > EditCliente(LaMinka.Logica.Model.Cliente cliente)
        {
            _context.Update(cliente);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCliente", new { id = cliente.Id }, cliente));
        }
Beispiel #2
0
        public async Task <IActionResult> PutCliente(int id, LaMinka.Logica.Model.Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(BadRequest());
            }

            _context.Entry(cliente).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClienteExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }