static void Main(string[] args) { ContactsRepo repo = new ContactsRepo(); Console.WriteLine("Visa kontaktlista? (J/N)"); var response = Console.ReadLine(); switch (response.ToUpper()) { case "J": var allContacts = repo.GetAllContacts(); foreach (var contact in allContacts) { Console.WriteLine(contact.ToString()); } break; default: break; } }
public ActionResult ViewAll() { List <Contact> list = repo.GetAllContacts(); return(View(list)); }