Beispiel #1
0
        public async Task <ActionResult <CourseGrpSetup> > PostCourseGrpSetup(CourseGrpSetup courseGrpSetup)
        {
            _context.CourseGrpSetup.Add(courseGrpSetup);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCourseGrpSetup", new { id = courseGrpSetup.Id }, courseGrpSetup));
        }
Beispiel #2
0
        public async Task <IActionResult> PutCourseGrpSetup(int id, CourseGrpSetup courseGrpSetup)
        {
            if (id != courseGrpSetup.Id)
            {
                return(BadRequest());
            }

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

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

            return(Ok(courseGrpSetup));
        }