Ejemplo n.º 1
0
        public async Task <IActionResult> PutContact(long id, Contact contact)
        {
            if (id != contact.Id)
            {
                return(BadRequest());
            }

            try
            {
                int data = await _context.UpdateContact(id, contact);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!await _context.VerifyContact(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(NoContent());
        }