8,497
社区成员
发帖
与我相关
我的任务
分享
public List<T> FindListByExpression(Expression<Func<T, bool>> where, string greedyLoad = "")
{
try
{
using (context = new qqMarketingEntities1())
{
var query = context.Set<T>();
if (!string.IsNullOrEmpty(greedyLoad))
{
List<string> greedyLoads = greedyLoad.Split(',').ToList();
/*foreach (var i in greedyLoads)
{
query.Include(i);
}
query.Where(where);*/无法查询,请问这里如何修改
}
List<T> result = query.ToList<T>();
return result;
}
}
catch (Exception e)
{
throw e;
}
}
public List<T> FindListByExpression(Func<T, bool> where, string greedyLoad = "")
foreach (var i in greedyLoads){
query = query.Include(i);
}
query = query.Where(where);