I have a constructor for an object, which I'm trying to query against instantiations of using LINQ. Where one property has a given value, I need to return the value of another property
My constructor is as below:
public Job(string organisationType, string 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;
}
A couple of mock instances look as below:
List<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, "DesignContractsManager", 7, 2, 2));
JobList.Add(new Job("ArchitecturalPractice" , "DesignContractor" , 2, "BuildingDesign" , 1, "LeadArchitect" , 7, 2, 2));
JobList.Add(new Job("StructuralEngineeringPractice", "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("PlasteringAndPainting" , "GeneralContractor", 2, "Plastering" , 4, "Plasterer" , 6, 2, 2));
JobList.Add(new Job("PlasteringAndPainting" , "GeneralContractor", 2, "Painting" , 5, "Painter" , 8, 2, 2));
My query so far looks like this (though not working obviously):
int jobStepNodeCountForJob = JobList.Where(j => j.LevelNumber == 1).Where(j => j.JobNumberOnLevel == 2).Select(;
Any help would be appreciated
My constructor is as below:
public Job(string organisationType, string 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;
}
A couple of mock instances look as below:
List<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, "DesignContractsManager", 7, 2, 2));
JobList.Add(new Job("ArchitecturalPractice" , "DesignContractor" , 2, "BuildingDesign" , 1, "LeadArchitect" , 7, 2, 2));
JobList.Add(new Job("StructuralEngineeringPractice", "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("PlasteringAndPainting" , "GeneralContractor", 2, "Plastering" , 4, "Plasterer" , 6, 2, 2));
JobList.Add(new Job("PlasteringAndPainting" , "GeneralContractor", 2, "Painting" , 5, "Painter" , 8, 2, 2));
My query so far looks like this (though not working obviously):
int jobStepNodeCountForJob = JobList.Where(j => j.LevelNumber == 1).Where(j => j.JobNumberOnLevel == 2).Select(;
Any help would be appreciated