我有一个对象的构造函数,我正在尝试查询使用LINQ的实例化。当一个属性具有给定值时,我需要返回另一个属性的值
我的构造函数如下:
公共Job(字符串organizationType,字符串contractingOrganisationType,int levelNumber,string jobName,int jobNumberOnLevel,string jobExecutor,int stepCount,int customInputCount,int customOutputCount)
{
OrganisationType = OrganisationType;
ContractingOrganisationType = contractingOrganisationType;
LevelNumber = levelNumber;
JobName = jobName;
JobNumberOnLevel = jobNumberOnLevel;
JobExecutor = jobExecutor;
StepCount = stepCount;
CustomInputCount = customInputCount;
CustomOutputCount = customOutputCount;
}
几个模拟实例如下所示:
列表<Job> JobList = new List<Job>();
JobList.Add(new Job("Owner",null,0,"ProjectBriefCreation" , 1, "ProjectOwner",5,2,2));
JobList.Add(new Job("GeneralContractor" , "Owner",1"ProjectManagement" , 1, "ContractsManager",7,2,2));
JobList.Add(new Job("DesignContractor" , "Owner",1"DesignManagement" , 2, "设计合同经理", 7, 2, 2));
JobList.Add(new Job("建筑实践" , "DesignContractor" , 2, "BuildingDesign" , 1, "LeadArchitect" ,7,2,2));
JobList.Add(new Job("结构工程实践", "DesignContractor" , 2, "StructuralDesign" , 2, "StructuralEngineer",7,2,2));
JobList.Add(new Job("Carpentry" , "GeneralContractor", 2, "Drywalling",3,"Carpenter" ,5,2,2));
JobList.Add(new Job("抹灰和绘画" , "GeneralContractor", 2, "Plastering",4"Plasterer",6,2,2));
JobList.Add(new Job("抹灰和绘画" , "GeneralContractor", 2, "Painting",5"Painter",8,2,2));
到目前为止,我的查询看起来像这样(尽管显然不能正常工作):
int jobStepNodeCountForJob = JobList.Where(j =>j.LevelNumber == 1)。其中(j =>j.JobNumberOnLevel == 2).Select(;
任何帮助,将不胜感激
我的构造函数如下:
公共Job(字符串organizationType,字符串contractingOrganisationType,int levelNumber,string jobName,int jobNumberOnLevel,string jobExecutor,int stepCount,int customInputCount,int customOutputCount)
{
OrganisationType = OrganisationType;
ContractingOrganisationType = contractingOrganisationType;
LevelNumber = levelNumber;
JobName = jobName;
JobNumberOnLevel = jobNumberOnLevel;
JobExecutor = jobExecutor;
StepCount = stepCount;
CustomInputCount = customInputCount;
CustomOutputCount = customOutputCount;
}
几个模拟实例如下所示:
列表<Job> JobList = new List<Job>();
JobList.Add(new Job("Owner",null,0,"ProjectBriefCreation" , 1, "ProjectOwner",5,2,2));
JobList.Add(new Job("GeneralContractor" , "Owner",1"ProjectManagement" , 1, "ContractsManager",7,2,2));
JobList.Add(new Job("DesignContractor" , "Owner",1"DesignManagement" , 2, "设计合同经理", 7, 2, 2));
JobList.Add(new Job("建筑实践" , "DesignContractor" , 2, "BuildingDesign" , 1, "LeadArchitect" ,7,2,2));
JobList.Add(new Job("结构工程实践", "DesignContractor" , 2, "StructuralDesign" , 2, "StructuralEngineer",7,2,2));
JobList.Add(new Job("Carpentry" , "GeneralContractor", 2, "Drywalling",3,"Carpenter" ,5,2,2));
JobList.Add(new Job("抹灰和绘画" , "GeneralContractor", 2, "Plastering",4"Plasterer",6,2,2));
JobList.Add(new Job("抹灰和绘画" , "GeneralContractor", 2, "Painting",5"Painter",8,2,2));
到目前为止,我的查询看起来像这样(尽管显然不能正常工作):
int jobStepNodeCountForJob = JobList.Where(j =>j.LevelNumber == 1)。其中(j =>j.JobNumberOnLevel == 2).Select(;
任何帮助,将不胜感激