Beispiel #1
0
        public async Task <IActionResult> PutUser(long id, Dbusers user)
        {
            //if (id != user.IdUser)
            //{
            //    return BadRequest();
            //}

            user.FuckingUserId = id;

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <IActionResult> PutPassedTasks(long id, PassedTasks passed_task)
        {
            //if (id != passed_task.PassedTasksId)
            //{
            //    return BadRequest();
            //}

            passed_task.PassedTaskId = id;

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

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

            return(NoContent());
        }