Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Children could not be evaluated" in EF 6

Recently, I updated a project to Entity Framework 6 (VS2013). But, when I'm trying expand the results of a query on the debug mode (using breakpoints) this message appears: "Children could not be evaluated"

The query, is this:

using ( SystemDataContext objDB = new SystemDataContext() )
    var obj = (
        from x in objDB.Functionality
        orderby x.ID
        select new
        {
            ID = x.ID,
        }
    );

Error

What is happening?

like image 675
BernardoMorais Avatar asked Jan 27 '14 18:01

BernardoMorais


1 Answers

I got the same error using the generic repository pattern,but during the implementation of repository pattern in GetAll() method, I used .Tolist().then its work fine.

    public IEnumerable<T> GetAll()
    {
        return _dbSet.AsEnumerable<T>().ToList();
    }
like image 135
Shyam Gupta Avatar answered Oct 18 '22 03:10

Shyam Gupta