Expression<Func<T, bool>> exp = o => true;
if (type==0) exp = e => e.CreateTime >= begintime && e.CreateTime <= endtime;
if (!string.IsNullOrWhiteSpace(taskname)) exp = e => e.Name.Contains(taskname);
var dataSource=qry.Where(exp).toList();