JSINQ (Linq for JavaScript library) sub-queries (how-to)

Posted by Tom Tresansky on Stack Overflow See other posts from Stack Overflow or by Tom Tresansky
Published on 2010-03-31T01:12:05Z Indexed on 2010/03/31 1:13 UTC
Read the original article Hit count: 527

I'm using this library: jsinq.

I want to create a new object using subqueries. For example, in .NET LINQ, I could do something like this:

from a in Attendances
where a.SomeProperty = SomeValue
select new {
    .Property1 = a.Property1,
    .Property2 = a.Property2,
    .Property3 = (from p in People
                  where p.SomeProperty = a.Property3
                  select p)
}

such that I get a list of ALL people where Property3 value matches the attendance's Property3 value in EACH object returned in the list.

I didn't see any sample of this in the docs or on the playground. Made a couple tries of it and didn't have any luck.

Anybody know if this is possible and how to?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about JavaScript