Webforms data binding with EF Code-First Linq query error

前端 未结 3 1324
日久生厌
日久生厌 2020-12-16 02:02

In this example here, Scott shows doing a Linq query against the dbContext and binding the result directly to a GridView to show a list of products. His example is using the

3条回答
  •  没有蜡笔的小新
    2020-12-16 02:35

    In looking at the EF4 Feature CTP4 release dll in Reflector, I can see that its DBQuery object does not implement IListSource.GetList() and throw an exception as the EF 4.1 dll does. I guess somewhere along the line they had a reason to no longer allow binding directly to the query, even though it implements IEnumerable.

    This does not answer WHY they made this change, but at least I can see that there is a reason it would work in the older version.

提交回复
热议问题