Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8653721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:36:41+00:00 2026-06-12T14:36:41+00:00

I try to create some linq query like following. I have a table with

  • 0

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/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:36:43+00:00Added an answer on June 12, 2026 at 2:36 pm

    I’m not sure I understand what you’re asking, but it sounds like:

    var resourcePlanning = new ResourcePlanningManager().Repository.Find(
                rp => rp.EmployeeID == employeeRosterPeriod.EmployeeID &&
                      rp.PlanDate >= employeeRosterPeriod.DateFrom &&
                      rp.PlanDate <= employeeRosterPeriod.DateTo
            )
            .GroupBy(rp => rp.weekID)
            .Where(g => g.Sum(rp => rp.deployedPlanning) > 40)
            .FirstOrDefault();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some buttons I am trying to create, and when I try to
I try to create some li elements in my XUL Application. Theres only the
I try to create some correct XAML to arrange text in the ComboBox to
I'm getting some weird things happening when I try to create an AVD or
I try to create a very simple app using windows API. I've done some
I am attempting to add some entities that I have created. When I try
I want to try create something like Zend's Server Pagecache. What I want to
I've got some code to try and loop through LINQ results, but it doesn't
Currently i try to create some of my database export work more automated and
I try to create some kind of file browser. I want to know if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.