예제 #1
0
        public async Task <ActionResult <InterviewBookUser> > PostInterviewBookUser([FromBody] InterviewBookUser interviewBookUser)
        {
            _context.InterviewBookUser.Add(interviewBookUser);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetInterviewBookUser", new { id = interviewBookUser.ID }, interviewBookUser));
        }
예제 #2
0
        public async Task <IActionResult> PutInterviewBookUser(Guid id, InterviewBookUser interviewBookUser)
        {
            if (id != interviewBookUser.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }