Skip to content

How to do sub-queries? #46

@jfrank14

Description

@jfrank14

I need to do a ContainingAll query on an object's scalar properties and that of a child collection object.

q = q.Search(Function(t) t.Name,
    Function(t) t.ClassName,
    Function(t) t.OrderNumber).
    ContainingAll(fields).
    Where(Function(t) t.Contacts.Search(Function(x) x.Name).ContainingAll(fields).Any)

That t.Contacts property is itself a collection that I need to search, but doing it this way throws the exception System.NotSupportedException: 'LINQ to Entities does not recognize the method 'NinjaNye.SearchExtensions.EnumerableStringSearch'1[Suntex.FirstInMath.Models.Api.Admin.Teams+Contact] ContainingAll(System.String[])' method, and this method cannot be translated into a store expression.'

Is there a way to do this kind of sub-query?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions