예제 #1
0
        public async Task <ActionResult <InstTypeSetup> > PostInstTypeSetup(InstTypeSetup instTypeSetup)
        {
            _context.InstTypeSetup.Add(instTypeSetup);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetInstTypeSetup", new { id = instTypeSetup.Id }, instTypeSetup));
        }
예제 #2
0
        public async Task <IActionResult> PutInstTypeSetup(int id, InstTypeSetup instTypeSetup)
        {
            if (id != instTypeSetup.Id)
            {
                return(BadRequest());
            }

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

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

            return(Ok(instTypeSetup));
        }