public IEnumerable<Contact> GetContacts(Group group) { if (group.Name == "Exchange") { yield return new Contact("Nicole", "Kidman", "Actor"); yield return new Contact("Russel", "Crowe", "Actor"); yield return new Contact("Geoffrey", "Rush", "Actor"); yield return new Contact("Mel", "Gibson", "Actor"); yield return new Contact("Sam", "Neil", "Actor"); yield return new Contact("Hugh", "Jackman", "Actor"); yield return new Contact("Eric", "Bana", "Actor"); yield return new Contact("Cate", "Blanchett", "Actor"); yield return new Contact("Rachel", "Griffiths", "Actor"); yield return new Contact("Naomi", "Watts", "Actor"); yield return new Contact("Miranda", "Otto", "Actor"); yield return new Contact("Errol", "Flynn", "Actor"); } else { yield return new Contact("Ray", "Meagher", "Actor"); yield return new Contact("Kate", "Ritchie", "Actor"); yield return new Contact("Lynne", "McGranger", "Actor"); yield return new Contact("Norman", "Coburn", "Actor"); yield return new Contact("Chloe", "Marshall", "Actor"); } }
public ActionResult Group(Group group) { var contacts = _contactRepository.GetContacts(group); return Page(new GroupViewModel(group.Name, contacts)); }