public async Task <ActionResult <tbOpSubject> > PostOpSubject(tbOpSubject Ops) { _context.OpSubjects.Add(Ops); await _context.SaveChangesAsync(); return(CreatedAtAction("GetOpSubject", new { id = Ops.SubjectID }, Ops)); }
public async Task <IActionResult> PutOpSubject(string id, tbOpSubject Ops) { if (id != Ops.SubjectID) { return(BadRequest()); } _context.Entry(Ops).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OpSubjectExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }