예제 #1
0
        public async Task <IActionResult> PutParte3([FromRoute] int id, [FromBody] Parte3 parte3)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != parte3.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PostParte3([FromBody] Parte3 parte3)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Parte3.Add(parte3);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetParte3", new { id = parte3.Id }, parte3));
        }