-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search on joined data #17
Comments
Hi @twilly86, I'm assuming you've tried to complete this using SearchExtensions. Be great if this was supported. I'm currently working on another issue but will try and put some time in to see if there is a quick win here to be had. |
1 similar comment
Hi @twilly86, I'm assuming you've tried to complete this using SearchExtensions. Be great if this was supported. I'm currently working on another issue but will try and put some time in to see if there is a quick win here to be had. |
Hi! |
Hi @Prefsmaster Thanks for giving this a bump. It's been a while since I looked over this issue and it has gone stale as a result, so apologies for that. Could you clarify what functionality it is you would like to support? We do have var result = testData.SearchChildren(x => Children)
.With(c => c.Name).Containing("rob")
.With(c => c.Age).GreaterThan(20) But I'm guessing this does not meet your needs |
Hey, thanks for the quick response, I will take a look at SearchChildren, but fear it may not get the job done. We have a bunch of tags hanging off an entity, and I want to select all entities where some properties or one of the attached tags contains any of the (array of) substrings. We had a previous implementation that could search for only one string:
but now we want to be able to search for multiple substrings in both the parent and the child-entities.
But Linq to Entities doesn's support the string.Join (nor Aggregate). So that's why I bumped this issue :-) |
This is by no means a nice solution but could something like this work to get you going? var nameMatch = persons.Search(x => x.FirstName, x => x.LastName).Containing(searchTerms);
var tagMatch = persons.SearchChildren(x => x.Tags).With(x => x).Containing(searchTerms);
var result = name.Union(tagMatch); |
Thanks again!
so only the tags added by the provided manager are searched/returned. cheers! |
If I understand correctly, then maybe something like this... var nameMatch = persons.Search(x => x.FirstName, x => x.LastName).Containing(searchTerms);
var tagMatch = persons.SearchChildren(x => x.Tags)
.With(t => t.ManagerId).EqualTo(managerId)
.With(t => t.Tag).Containing(searchTerms);
var result = name.Union(tagMatch); |
Somehow I made a mistake earlier.
now somehow yields all persons, not only the ones tagged with a tag containing the substring(s). |
I was using predicate builder prior to switching to your library and was doing searches on joined data.
Example..
Is this possible?
The text was updated successfully, but these errors were encountered: