Example #1
0
        public void Delete(int Id)
        {
            Categoria categoria = FindCategoriaById(Id);

            _context.Remove(categoria);
            _context.SaveChanges();
        }
Example #2
0
 public void Delete(int id)
 {
     try
     {
         var obj = _context.Produto.Find(id);
         _context.Produto.Remove(obj);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }