public void LoadData() { using (var context = new DbContext()) { _repository = new ProductRepository(context); var list = _repository.GetAll(); _view.OnLoadData(list); } }