"Children could not be evaluated" in EF 6

debugging entity-framework-6 visual-studio-2013

Question

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?

Popular Answer

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();
    }



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why