Skip to main content
Home  › ... Razor

LINQ Tutorial (Language INtegrated Query)

Tutorial HomeLINQ
#2 LINQ Relationships - Children, Parents, Grandchildren, ...

LINQ Relationships - Children, Parents, Grandchildren, ...

The samples can differ based on your Razor base class or if you're running an old version.
Switch to Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)

Accessing Authors, a List inside of Books

Grouping by Authors, a List inside of Books

Books.Authors.Awards, a List in a List in a List

Find Parents of Authors - Things that point to Authors

In this example, we'll start with the authors list. This is probably not ideal - as some people are not authors, but it's a good learning example. To find the books we have to navigate through Parents(...) because in our data-model, the books reference authors, not the authors to books.

 

 

#2 LINQ Relationships - Children, Parents, Grandchildren, ...