Ejemplo n.º 1
0
        public ActionResult Delete(Guid id)
        {
            var user = _StickyNotes.Users.FirstOrDefault(p => p.Id == id);

            if (user is null)
            {
                return(NotFound());
            }

            _StickyNotes.Remove(user);
            _StickyNotes.SaveChanges();
            return(NoContent());
        }
Ejemplo n.º 2
0
        public ActionResult Delete(Guid userId, Guid id)
        {
            var author = _stickyNotes.Users.FirstOrDefault(p => p.Id == userId);

            if (author is null)
            {
                return(NotFound());
            }

            var book = _stickyNotes.StickyNotes.FirstOrDefault(p => p.Id == id);

            if (book is null)
            {
                return(NotFound());
            }

            _stickyNotes.Remove(book);
            _stickyNotes.SaveChanges();
            return(NoContent());
        }
 public void Delete(Note entity)
 {
     _context.Remove(entity);
 }
 public void Delete(User entity)
 {
     _context.Remove(entity);
 }