I'm a bit confused why this piece of code produces 2 records in a list (acts appropriately):
var historiesToRemove = new List<WorkHistory>();
foreach (var history in this.WorkHistories)
{
if (history.Tool.Equals(item))
{
historiesToRemove.Add(history);
}
}
While this piece of code produces an empty list:
var historiesToRemove = this.WorkHistories.Where(history => history.Tool.Equals(item)).ToList();
Any ideas why could this happen?
REASON:
I didn't properly implement IDbSet's IQueryable properties. This made my LINQ act wrong.