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?