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 463935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:13:29+00:00 2026-05-12T23:13:29+00:00

Original I don’t get why the Where() clause doesn’t give me the right results

  • 0

Original

I don’t get why the Where() clause doesn’t give me the right results in the last example.
It isn’t any different is it? Why does C# behaves differently?

transactions = IEnumerable<Transaction> //pseudocode 

//This works: It gives me the transaction I need.
DateTime startDate = DateTime.Parse(parameter.Constraint); 
transactions = transactions.Where(T => T.date >= startDate);  

//This doesn't work... No actual code changed, only the way of writing it...
//I get 0 results.
 transactions = transactions.Where(T => T.date >= DateTime.Parse(parameter.Constraint));

Edit

Ok, it is indeed relevant to mention that transactions is loaded using Entity Framework.

transactions = this.db.Include("blablabla").OrderByDescending(T => T.date);

Maybe that’s why it’s doing weird? Because of the way Entity Linq works?

  • 1 1 Answer
  • 1 View
  • 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-05-12T23:13:29+00:00Added an answer on May 12, 2026 at 11:13 pm

    The only way this could actually be happening is if you were modifying parameter or parameter.Constraint somehow while you’re enumerating through transactions. So if you’re not doing that, look at whether you’re actually observing what you think you’re observing.

    In principle, this should work fine.

    EDIT: One obvious way you could be confused about your observation is if you didn’t check the results of (actually evaluate) the lazy Where enumeration until later on, when parameter had changed. If you put a ToArray on the end to evaluate it immediately, you might find that it “magically” fixes itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know the original rationale, or story, of the different platforms each choosing
I don't get what am I doing wrong here Live example at JSBin If
With version 1.1 I don't understand how I can preprocess the original image (by
Original format: <a href=http://www.example.com/t434234.html ...> 1. I need to fetch all URLs of this
I don't know how to get it to work the best way. I need
Original: http://mbostock.github.com/d3/ex/force.html In his example as provided in the above link, I'm simply trying
I don't have access, right now, to test this, but is the following --
The original location ( strange behaviour on another process via Process.Start(startInfo) ) doesn't allow
I don't think I was specific enough last time. Here we go: I have
I am using this PHP script to generate identicons. It uses Don Park's original

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.