In my silverlight project I have many views that all need the same method, "Tester()". Obviously I want this method to be resusable but I am just not getting there.
What I have is this:
void Tester(IList<MyEntity> list)
{
var sortedlist=list.OrderBy(me=>me.Sortkey).ToList();
}
This works fine, but only for MyEntity.
What I really want is essentially this:
void Tester<T>(IList<T> list, string mySortField)
{
var sortedlist=list.OrderBy("mySortField").ToList();
}
Doesn't compile.
Any ideas how to do this, please ? Thx in advance, Frank