public async Task <ActionResult <Todoitemsecond> > PostTodoitemsecond(Todoitemsecond Todoitemsecond) { _context.Todoitemseconds.Add(Todoitemsecond); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetTodoitemsecond), new { id = Todoitemsecond.Id }, Todoitemsecond)); }
public async Task <IActionResult> PutTodoitemseconds(long id, Todoitemsecond todoitemsecond) { if (id != todoitemsecond.Id) { return(BadRequest()); } _context.Entry(todoitemsecond).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TodoitemsecondExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }