开发者

query only returning one result

开发者 https://www.devze.com 2023-01-20 01:01 出处:网络
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 quer

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消