static class Extend
{
public static IList<T> GetALL<T>(this IList<T> table, string field) where T : class
{
var pm = Expression.Parameter(typeof(T), "f");
var body = Expression.Property(pm, field);
var lambdaEx = Expression.Lambda<Func<T, Int32>>(body, pm);
return table.OrderBy(lambdaEx.Compile()).ToList();
}
public static IQueryable<SurveryData> GetALL(this IQueryable<SurveryData> table, string field)
{
var result = table.OrderBy(s => s.SurveryPoint.SurveryPointName);
return result;
}
}