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

Compute - Include - Decompile problem #52

Closed
mayorovp opened this issue Jun 9, 2015 · 2 comments
Closed

Compute - Include - Decompile problem #52

mayorovp opened this issue Jun 9, 2015 · 2 comments

Comments

@mayorovp
Copy link

mayorovp commented Jun 9, 2015

Look at this test:

    [Test]
    public void ComputeIncludeDecompileNotFail()
    {
        using (var db = new EfTestDbContext())
        {
            db.EfParents.Where(p => ComputedSample()).Include(p => p.Children).Decompile().Load();
        }
    }

    [Computed]
    private static bool ComputedSample() { return true; }

What happens here? Include returns IQueryable with expression like value(ObjectQuery<...>).Include("Children"). Call of function ComputedSample() is hidden in constant expression and ignored by DelegateDecompiler. => EF fails to execute query.


Что тут происходит? Вызов Includeвозвращает IQueryable с выражением вроде value(ObjectQuery<...>).Include("Children"). Здесь вызов функции ComputedSample() скрыт в константном выражении - а потому игнорируется библиотекой DelegateDecompiler. Как следствие - EF не может выполнить запрос.

@mayorovp
Copy link
Author

Maybe this issue is a duplicate of #38

@hazzik
Copy link
Owner

hazzik commented Jun 18, 2015

Duplicates #38

@hazzik hazzik closed this as completed Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants