Esempio n. 1
0
        public async Task <IActionResult> PutChatroomMember(string id, ChatroomMember chatroomMember)
        {
            if (id != chatroomMember.ChatroomMemberId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutMessage(string id, Message message)
        {
            if (id != message.MessageId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }