示例#1
0
        public async Task <ActionResult <ProgramGroups> > PostProgramGroups(ProgramGroups programGroups)
        {
            _context.ProgramGroups.Add(programGroups);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProgramGroups", new { id = programGroups.BoardID }, programGroups));
        }
示例#2
0
        public async Task <IActionResult> PutProgramGroups(int id, ProgramGroups programGroups)
        {
            if (id != programGroups.BoardID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }