摘要:
stringpropertyName=GridViewSortExpression;Func<Entity,object>orderbyField=entity=>entity.GetType().InvokeMember(propertyName,BindingFlags.GetProperty,null,entity,newobject[]{});GridView.DataSource=GridViewSortDirection==SortDirection.Ascending?entities.OrderBy(orderbyField):entities.OrderBy 阅读全文