Beispiel #1
0
        public async Task <IActionResult> PutClient(int id, Clients updatedClient)
        {
            updatedClient.id = id;

            _context.Entry(updatedClient).State = EntityState.Modified;
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClientExists(id))
                {
                    return(null);
                }
                else
                {
                    throw;
                }
            }
            return(null);
        }
Beispiel #2
0
        public async Task <IActionResult> PutQueue(int id, Queue updatedQueue)
        {
            updatedQueue.id = id;

            _context.Entry(updatedQueue).State = EntityState.Modified;
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!appointmentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(Ok(updatedQueue));
        }