コード例 #1
0
        public async Task <IActionResult> PutInterviewInvitation(int id, InterviewInvitation interviewInvitation)
        {
            if (id != interviewInvitation.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
        public async Task <ActionResult <InterviewInvitation> > PostInterviewInvitation(InterviewInvitation interviewInvitation)
        {
            _context.interviewInvitations.Add(interviewInvitation);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetInterviewInvitation", new { id = interviewInvitation.Id }, interviewInvitation));
        }