Exemplo n.º 1
0
        public ActionResult SearchByCountry(SearchByName item)
        {
            // Fetch the collection
            var c = m.CustomerGetAllByCountry(item.Name);

            // Pass the collection to the view, sorted
            // Now do you understand why we can (and should) do the "order by" work in the Manager class?
            // If there's a natural order to the results, then do it
            return(View("index", c.OrderBy(ln => ln.LastName).ThenBy(fn => fn.FirstName)));
        }
Exemplo n.º 2
0
 public ActionResult SearchByName(SearchByName item)
 {
     // Fetch the sorted collection, and pass it to the view
     return(View("index", m.CustomerGetAllByName(item.Name)));
 }