Beispiel #1
0
        public async Task <ActionResult <Saved_Posts> > PostTodoItem(Saved_Posts item)
        {
            _context.Saved_Posts.Add(item);
            await _context.SaveChangesAsync();

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

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

            return(NoContent());
        }