views:

44

answers:

1

Hey, I am pretty certain I am doing something incorrectly with my lambda expression and that is making it so that I only return a single result. If there is nothing wrong with my query (it has the ability to return multiple results), then I must have an error elsewhere and I should be able to find it. If my results should return more than one result for the third part of the or, only one is being returned. Am I doing something wrong here?

var proQuery = from a in solutionContext.Products
                       where a.ID == solutionID ||
                       (a.ParentID == solutionID && a.Versions.All(c => c.VersionNumber == activeNumber)) ||
                       (a.Product2.ParentID == solutionID &&
                            a.Versions.All(c => c.VersionNumber == activeNumber))
                       select a;

If there is anymore information you need, I would be happy to help.

+2  A: 

There isn't really enough here for us to go on, but are you sure that the Alls are correct and shouldn't be Anys? Absent additional information, that's one thing to look at.

Jason
@Jason Thanks! That did the trick. Have a good one.
PFranchise