I try to create some linq query like following.
I have a table with resource planning items. There is a column weekID and a column deployedPlanning. I would like to check if the count of deployedPlanning in each week is not higher than 40 hours. I need to add some extra where filters on the linq query below but I dont know how 🙁 Can someone tell me how I can add these where filter on the current linq query below?
var resourcePlanning = new ResourcePlanningManager().Repository.Find(
rp => rp.EmployeeID == employeeRosterPeriod.EmployeeID &&
rp.PlanDate >= employeeRosterPeriod.DateFrom &&
rp.PlanDate <= employeeRosterPeriod.DateTo).FirstOrDefault();
if (resourcePlanning != null)
{
// throw excetoption. There are more than 40 hours planned in 1 or more weeks in this range!
}
for example in week 40 there are in total 24 DeployedPlanned hours. This is not higher than 40 so its OK.
http://imageshack.us/photo/my-images/513/tableresourceplanning.png/
I’m not sure I understand what you’re asking, but it sounds like: