我可以在此LINQ查询中执行Where子句吗?

时间:2009-11-25 17:03:24

标签: vb.net linq

Dim dataContext As New ACSLostFoundEntities()

Dim query = From s In dataContext.FosterForms() _
            Join c In dataContext.Fosters() _
            On c.License Equals s.License _
            Where s.Deleted = "False" _
            Select New With {.License = s.License, _
                             .LastName = s.LastName, _
                             .FirstName = s.FirstName, _
                             .Status = s.Status, _
                             .WantedPets = dataContext.WantedPets(c)}

最后,我想做一个WantedPets.Contains(criteria),这可能吗?谢谢!

1 个答案:

答案 0 :(得分:2)

为什么没有

Where s.Deleted = "False" _
AndAlso dataContext.WantedPets(c).Contains(criteria) _

我错过了一些明显的东西吗?