Ejemplo n.º 1
0
        public async Task <ActionResult <TblDirection> > PostTblDirection(TblDirection tblDirection)
        {
            _context.TblDirection.Add(tblDirection);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTblDirection", new { id = tblDirection.IdDirection }, tblDirection));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutTblDirection(int id, TblDirection tblDirection)
        {
            if (id != tblDirection.IdDirection)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }