PFranchise
PFranchise

Reputation: 6762

query only returning one result

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.

Upvotes: 0

Views: 108

Answers (1)

jason
jason

Reputation: 241711

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.

Upvotes: 2

Related Questions