查询优化
This commit is contained in:
@@ -19,12 +19,12 @@ namespace BLL
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in Funs.DB.SitePerson_Person
|
||||
where x.IsUsed == true
|
||||
select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.SitePerson_Person> getDataLists = from x in Funs.DB.SitePerson_Person
|
||||
// where x.IsUsed == true
|
||||
// select x;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -38,7 +38,9 @@ namespace BLL
|
||||
Grid Grid1)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
|
||||
IQueryable<Model.SitePerson_Person> getDataList = from x in db.SitePerson_Person
|
||||
where x.IsUsed == true
|
||||
select x;
|
||||
if (projectId != Const._Null && !string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ProjectId == projectId);
|
||||
|
||||
Reference in New Issue
Block a user