public void Save(Product obj) { var result = 0; using (var context = new DbContext()) { _repository = new ProductRepository(context); result = _repository.Save(obj); if (result > 0) { _view.OnSaved(obj); } else { _view.OnFailed("Data produk gagal disimpan"); } } }