Skip to content
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

Cannot execute empty query #861

Closed
tusmester opened this issue Jan 14, 2020 · 0 comments
Closed

Cannot execute empty query #861

tusmester opened this issue Jan 14, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@tusmester
Copy link
Member

@tusmester tusmester commented Jan 14, 2020

We get an exception when executing a full repository query in an asp.net core environment:

@using (new SystemAccount())
{
    <ul>
        @foreach (var c in Content.All.OrderBy(c => c.Path))
        {
            <li>@c.Path</li>
        }
    </ul>
}

The exception

NotSupportedException: Cannot execute empty query. Expression: value(SenseNet.ContentRepository.Linq.ContentSet`1[SenseNet.ContentRepository.Content]).OrderBy(c => c.Path)

Workaround

Adding the .OfType<GenericContent>() clause to the expression eliminates the exception.

@tusmester tusmester added this to the Sprint 201 milestone Jan 14, 2020
@herflis herflis modified the milestones: Sprint 201, Sprint 202 Jan 22, 2020
@tusmester tusmester closed this Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.