public AllCustomerNamesViewModel GetCustomerNameList() { List <Customer> allCist = rs.GetAllCustomers(); List <string> list = new List <string>(); AllCustomerNamesViewModel allNames = new AllCustomerNamesViewModel(); foreach (var item in allCist) { string names = item.firstName + " " + item.lastName; list.Add(names); } allNames.nameList = list; return(allNames); }
public ActionResult ListAllCustomers() { AllCustomerNamesViewModel nameList = blc.GetCustomerNameList(); return(View("ListAllCustomers", nameList)); }