示例#1
0
        public async Task <ActionResult <TodoItem57> > PostTodoItem(TodoItem57 item57)
        {
            _context.TodoItems57.Add(item57);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetTodoItem), new { id = item57.Id }, item57));
        }
示例#2
0
        public async Task <IActionResult> PutTodoItem(long id, TodoItem57 item57)
        {
            if (id != item57.Id)
            {
                return(BadRequest());
            }

            _context.Entry(item57).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }