我正在从EF5升级到EF6,为此,我在Web应用程序中使用了新发布的EntityDataSource控件http://blogs.msdn.com/b/webdev/archive/2014/02/28/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx

我面临的问题是将实体数据源控件更改为:

<ef:EntityDataSourceID="GridDataSource"runat="server"EnableDelete="true"/>


所有事件都采用不正确的旧命名空间“ System.web.UI.WebControls”,而不是正确的命名空间“ Microsoft.AspNet.EntityDataSource”。

我必须在许多地方进行编辑,但是我认为它应该由控件自动处理。

谁能帮我解决这个问题吗?

最佳答案

使用using指令引用名称空间,如下所示:

using EntityDataSource = Microsoft.AspNet.EntityDataSource.EntityDataSource;
using EntityDataSourceSelectingEventArgs = Microsoft.AspNet.EntityDataSource.EntityDataSourceSelectingEventArgs;
using EntityDataSourceChangingEventArgs = Microsoft.AspNet.EntityDataSource.EntityDataSourceChangingEventArgs;
using EntityDataSourceChangedEventArgs = Microsoft.AspNet.EntityDataSource.EntityDataSourceChangedEventArgs;
using EntityDataSourceContextCreatingEventArgs = Microsoft.AspNet.EntityDataSource.EntityDataSourceContextCreatingEventArgs;

关于c# - 事件未采用EntityDataSource控件的正确 namespace ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23608108/

10-10 23:18