I have two Entity Framework objects with a one-to-many relationship:
widget(parent) and widgetNail(child)
Widget has a text column: Title WidgetNail has a text column: Description
I would like to build a query that will return a list of Widgets that match one of two criteria:
- A text string is found in the Widget title, or
- The same text string is found in any WidgetNail description.
So far I have this, which doesn't work...
from widget in entities.Widgets
from widgetNail in entities.WidgetNails
where widget.Title.Contains(searchText)
|| widgetNail.Description.Contains(searchText)
select widget).ToList();