Exemplo n.º 1
0
        public async Task <IActionResult> PutIsRented(int id, bool rented, Rented rent)
        {
            if (id != rent.Id)
            {
                return(BadRequest());
            }
            _context.Entry(rent).State   = EntityState.Modified;
            _context.Entry(rented).State = EntityState.Modified;
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RentedExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutStudio(int id, Studio studio)
        {
            if (id != studio.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> PutTrivias(int id, Trivias trivias)
        {
            if (id != trivias.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }