示例#1
0
        public async Task <ActionResult <Parcelado> > PostParcelado(Parcelado parcelado)
        {
            _context.Parcelados.Add(parcelado);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetParcelado", new { id = parcelado.Id }, parcelado));
        }
示例#2
0
        public async Task <IActionResult> PutParcelado(int id, Parcelado parcelado)
        {
            if (id != parcelado.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }