Exemplo n.º 1
0
        public async Task Edit(Category category)
        {
            try
            {
                _context.Update(category);

                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                throw new Exception("Não foi possível editar a categoria. Tente novamente.");
            }
        }
Exemplo n.º 2
0
        public async Task Edit(Product Product)
        {
            try
            {
                _context.Update(Product);

                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                throw new Exception("Não foi possível editar o produto. Tente novamente.");
            }
        }