I have a list in a base class. Each derived class has its unique needs for sorting the common list in base-class. For this purpose I would like to create a method in base-class which gets a string. The string contains a custom "OrderBy"
query.
Instead of:
protected void SortBaseClassList(string orderByQueryString)
{
List<MyBaseClass> sortedList = BaseClassList.OrderByDescending(x => x.GetTop)
.ThenBy(x => x.GetLeft)
.ToList<MyBaseClass>();
}
I would like to use:
protected void SortBaseClassList(string orderByQueryString)
{
List<MyBaseClass> sortedList =
BaseClassList. + orderByQueryString + .ToList<MyBaseClass>();
}
Is this possible? If so, how can I do it?