public async Task <ActionResult <TbmCourseType> > PostTbmCourseType(TbmCourseType tbmCourseType) { _context.TbmCourseTypes.Add(tbmCourseType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTbmCourseType", new { id = tbmCourseType.Id }, tbmCourseType)); }
public async Task <IActionResult> PutTbmCourseType(int id, TbmCourseType tbmCourseType) { if (id != tbmCourseType.Id) { return(BadRequest()); } _context.Entry(tbmCourseType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbmCourseTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }