List<MyObjecT>
IF
private List<Customer> SortCustomer(string sortBy, string sortOrder) { // obviously I get this from a service in the real code var myList = new List<Customer>(); if (sortBy == "firstname" && sortOrder == "asc") { return myList.OrderBy(x => x.FirstName); } else if (sortBy == "firstname" && sortOrder == "desc") { return myList.OrderByDesc(x => x.firstName); } else if ..... // you get the idea }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)