Entity-Framework -> MySql gives 'Function evaluation timed out.'

倾然丶 夕夏残阳落幕 提交于 2019-12-14 01:21:55

问题


I having a weird problem with Entity Framework with MySql database.

Here's the code that I've got.

public class testbase
{
    private testEntities db = new testEntities();

    public IQueryable<post> GetRecords()
    {
        return db.record;
    }
}

Here record is a table in my database and this could should return all the rows in the table. I have only one row in there and when I do a db.record.Count(), I get 1.

But when I try to retrieve the rows themselves I get 'Function Evaluation timed out'.

What's happening? Anybody got any ideas?


回答1:


Okay, this turned out to be a dud question. Ben M was right. Some googling revealed: -

  1. EF does not behave well while debugging due to some issues in VS debugger. You get a 'Function evaluation timed out'.
  2. Things work swell when you try the code without debugging.

I was testing as I go for my new EF+MySql+ASP.Net.MVC app, and since I am a n00b at all three I didn't realize that.

I haven't deleted the question yet because there for others like me. It's on the community to decide whether to let this question survive or go.

I pronounce this question officially a dud.



来源:https://stackoverflow.com/questions/1141571/entity-framework-mysql-gives-function-evaluation-timed-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!