private void GetAll() { BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = personServices.GetAll(); dgv.DataSource = bindingSource; dgv.ClearSelection(); }
static void List() { // View Console.Clear(); // Controller // IDataMapper<Person> dalPerson = new PersonFileDataMapper(); // List<Person> persons = dalPerson.GetAll(); IPersonServices personServices = new PersonServices(); List <Person> persons = personServices.GetAll(); // View foreach (Person person in persons) { //Console.WriteLine("Id: {0}, Name: {1}", person.Id, person.Name); Console.WriteLine(person); } // View Console.WriteLine("Press any kay to go back"); Console.ReadLine(); }
public IEnumerable <Person> GetAll() { IEnumerable <Person> operationResult = _PersonServices.GetAll(); return(operationResult); }
public ActionResult Index() { var ps = new PersonServices(); return(View(ps.GetAll())); }