We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it possible to create a dynamic where condition with a collection property?
I'm trying to filter Parents which Childs.ChildProp1 == "test". What's the correct syntax ?
https://dotnetfiddle.net/Zh7Jy5
public class Parent { public string MasterProp1 { get; set; } public string MasterProp2 { get; set; } public IEnumerable<Child> Childs { get; set; } } public class Child { public string ChildProp1 { get; set; } public int ChildProp2 { get; set; } } Parents.Where("Childs.ChildProp1==\"test\"")
The text was updated successfully, but these errors were encountered:
Do you want the Parents who have a Child in Childs whose ChildProp1 matches "test"?
Parent
Child
Childs
ChildProp1
"test"
Parents.Where("Childs.Any(ChildProp1 == \"test\")")
Or do you want all the Childs whose ChildProp1 matches "test"?
Parents.SelectMany("Childs").Where("ChildProp1 == \"test\"")
Sorry, something went wrong.
@aysegulgurmeric Can you provide a working fiddle which represents this issue?
The fiddle you provided looks different?
StefH
No branches or pull requests
Is it possible to create a dynamic where condition with a collection property?
I'm trying to filter Parents which Childs.ChildProp1 == "test". What's the correct syntax ?
https://dotnetfiddle.net/Zh7Jy5
The text was updated successfully, but these errors were encountered: