public async Task <ActionResult <tbSpeSubject> > PostSpeSubject(tbSpeSubject Spes) { _context.SpeSubjects.Add(Spes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSpeSubject", new { id = Spes.SubjectID }, Spes)); }
public async Task <IActionResult> PutSpeSubject(string id, tbSpeSubject Spes) { if (id != Spes.SubjectID) { return(BadRequest()); } _context.Entry(Spes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeSubjectExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }