Esempio n. 1
0
        public async Task <IActionResult> PutFuncionesAsientosReservados(int id, FuncionAsientosReservados funcionesasientosreservados)
        {
            if (id != funcionesasientosreservados.FuncionId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult <FuncionAsientosReservados> > PostFuncionesAsientosReservados(FuncionAsientosReservados funcionesasientosreservados)
        {
            _context.FuncionesAsientosReservados.Add(funcionesasientosreservados);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (FuncionesAsientosReservadosExists(funcionesasientosreservados.FuncionId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetFuncionesAsientosReservados", new { id = funcionesasientosreservados.FuncionId }, funcionesasientosreservados));
        }