public JsonResult PopulateCustomers() { var customers = from cust in _customerTasks.GetListNotDeleted() select new { Id = cust.Id, CustomerName = cust.CustomerName + " - " + cust.CustomerPhone }; ViewData["customers"] = customers; return(Json(customers, JsonRequestBehavior.AllowGet)); }
public JsonResult PopulateCustomers() { IEnumerable <CustomerViewModel> customers = from cust in _customerTasks.GetListNotDeleted() select new CustomerViewModel { CustomerID = cust.Id, CustomerName = cust.CustomerName + " - " + cust.CustomerPhone }; ViewData["customers"] = customers; return(Json(customers, JsonRequestBehavior.AllowGet)); }