Exemplo n.º 1
0
        public async Task <IActionResult> PutTicketHistory(uint ticketHistoryId, TicketHistory ticketHistory)
        {
            if (ticketHistoryId != ticketHistory.Id)
            {
                return(BadRequest());
            }
            if (!TicketHistoryExists(ticketHistoryId))
            {
                return(NotFound());
            }
            _context.Entry(ticketHistory).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            } catch (Exception) {
                throw;
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PutManagedMember(uint?userAId, uint?userBId, UserRelationship managedMember)
        {
            if (!userAId.HasValue || !userBId.HasValue)
            {
                return(BadRequest());
            }
            if (!ManagedMemberExists(userAId.Value, userBId.Value))
            {
                return(NotFound());
            }

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

            try {
                await _context.SaveChangesAsync();
            } catch (Exception) {
                throw;
            }

            return(NoContent());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> PutComment(uint id, Comment comment)
        {
            if (id != comment.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }