Exemplo n.º 1
0
        public void Delete(Product obj)
        {
            var result = 0;

            using (var context = new DbContext())
            {
                _repository = new ProductRepository(context);

                result = _repository.Delete(obj);

                if (result > 0)
                {
                    _view.OnDeleted(obj);
                }
                else
                {
                    _view.OnFailed("Data produk gagal dihapus");
                }
            }
        }