Within a c# project I have two collections and I am trying to query them using a lambda to return a value
Pseudo code
Collection1
alertID
SavedItemID
SavedNameCollection2
SavedItemID
alertID
AlertType
DateCreated
var name = Collection2.where(c => c.savedItemID == Collection1.SavedItemID) return SavedName Property value from collection 1.
Basically in the inital query I am hitting collection2 I would like to navigate up from collection2 into collection one to return the Saved Name field. I have never attempted to navigate up through a tree to retrieve another object. Can anyone provide some suggestions on how to build this expression?
Thank you
You’ll need to use Join and then project an anonymous type consisting of the fields you care about.
This is equivalent to