Suppose I have:
class Person
{
[ColumnAttribute(\"ID\"]
public int Id;
[ColumnAttribute(\"Name\"]
public string Name;
[ColumnAttribute(\"DateOfBirth\"]
p
In addition to Pete M's answer you could pass the Func
used in IEnumerable
into your method, and order within your method
public IEnumerable GetAllByAge(int age, Func orderBy)
{
var people = ... (get your collection of 'age' aged people here)
return people.OrderBy(orderBy);
}
Usage would then be Dal.Person.GetAllByAge(25,p => p.BirthDate)