public static Func <Contact, object> Show() { return(PromptE.Select <Func <Contact, object> >("Ordering method") .Option("First name", x => x.FirstName) .Option("Middle name", x => x.MiddleName) .Option("Last name", x => x.LastName) .Option("Email", x => x.Email) .Option("Cellphone number", x => x.CellphoneNumber) .Option("Cancel", null) .Show()); }
public static Contact Show(ContactBook book) { var orderingField = OrderingMethodMenu.Show(); if (orderingField == null) { return(null); } var contacts = book.OrderBy(orderingField); var builder = PromptE.Select <Contact>("Select contact"); foreach (var contact in contacts) { builder.Option(contact.DisplayName, contact); } builder.Option("[Cancel]", null); return(builder.Show()); }