public async Task <IActionResult> PutSeccond([FromRoute] int id, [FromBody] Seccond seccond) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != seccond.ID) { return(BadRequest()); } _context.Entry(seccond).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SeccondExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostSeccond([FromBody] Seccond seccond) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Secconds.Add(seccond); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSeccond", new { id = seccond.ID }, seccond)); }