예제 #1
0
        public async Task <ActionResult <PersonalInfoTab> > PostPersonalInfoTab(PersonalInfoTab personalInfoTab)
        {
            _context.PersonalInfoTabs.Add(personalInfoTab);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPersonalInfoTab", new { id = personalInfoTab.ID }, personalInfoTab));
        }
예제 #2
0
        public async Task <IActionResult> PutPersonalInfoTab(int id, PersonalInfoTab personalInfoTab)
        {
            if (id != personalInfoTab.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }