public async Task <IActionResult> PutDifficulty(int id, Difficulty difficulty)
        {
            //if (id != difficulty.DifficultyId)
            //{
            //    return BadRequest();
            //}

            difficulty.DifficultyId = id;

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutTaskTestTopic(int id, TaskTestTopic task_test_topic)
        {
            //if (id != task_test_topic.TaskTestTopicId)
            //{
            //    return BadRequest();
            //}

            task_test_topic.TaskTestTopicId = id;

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

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

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutUserRole(int id, UserRole user_role)
        {
            //if (id != user_role.UserRoleId)
            //{
            //    return BadRequest();
            //}

            user_role.UserRoleId = id;

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutJournal(int id, Journal journal)
        {
            //if (id != journal.JournalId)
            //{
            //    return BadRequest();
            //}

            journal.JournalId = id;

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

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

            return(NoContent());
        }
Esempio n. 5
0
        public async Task <IActionResult> PutPassedTask(int id, PassedTask passed_task)
        {
            //if (id != passed_task.PassedTaskId)
            //{
            //    return BadRequest();
            //}

            passed_task.PassedTaskId = id;

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

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

            return(NoContent());
        }