예제 #1
0
        public async Task <IActionResult> PutFields(int id, Fields fields)
        {
            if (id != fields.FieldId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PutCourseScores(int id, CourseScores courseScores)
        {
            if (id != courseScores.CourseScoreId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }