public static IEnumerable<MyObject> WhereQuery(IEnumerable<MyObject> source, string columnName, string propertyValue)
{
// for sorting
//source.OrderBy(m=> m.GetType().GetProperty(columnName).ToString());
return source.Where(m => { return m.GetType().GetProperty(columnName).GetValue(m, null).ToString().StartsWith(propertyValue); });
}
{
// for sorting
//source.OrderBy(m=> m.GetType().GetProperty(columnName).ToString());
return source.Where(m => { return m.GetType().GetProperty(columnName).GetValue(m, null).ToString().StartsWith(propertyValue); });
}
No comments:
Post a Comment