Exemplo n.º 1
0
        public async Task DeleteAsync(int id)
        {
            User userToDel =
                await db.Users.FindAsync(id);

            db.Remove(userToDel);
        }
        public void Delete(int id)
        {
            Category category = _context.Categories.SingleOrDefault(cat => cat.ID == id);

            if (category != null)
            {
                _context.Remove(category);
                _context.SaveChangesAsync(true);
            }
        }
Exemplo n.º 3
0
 public async Task DeleteAsync(Photo model)
 {
     db.Remove(model);
 }