Ejemplo n.º 1
0
        public async Task <IActionResult> PutClass(int id, Classes classDetail)
        {
            if (id != classDetail.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutAssignment(int id, Assignments assignmentDetails)
        {
            if (id != assignmentDetails.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AssignmentDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(NoContent());
        }
Ejemplo n.º 3
0
 public async Task <IActionResult> UpdateUser(int id, Users user)
 {
     if (id != user.Id)
     {
         return(BadRequest());
     }
     _context.Entry(user).State = EntityState.Modified;
     try
     {
         await _context.SaveChangesAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!UserExists(id))
         {
             return(NotFound());
         }
         else
         {
             throw;
         }
     }
     return(NoContent());
 }