예제 #1
0
        public async Task <IActionResult> PutUserId(int id, UserId userId)
        {
            if (id != userId.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult> PutInteraction(int id, Interaction interaction)
        {
            if (id != interaction.InteractionId)
            {
                return(BadRequest());
            }
            _context.Entry(interaction).State = EntityState.Modified;
            try {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException) {
                if (!InteractionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }