我在一个应用程序中有两个 DBContext 类。MyMvcContext和自动生成的UserContext.
我一直在开发一个使用MyMvcContext一段时间的网络应用程序。现在我需要修改UserProfile在 context 中的类UsersContex。我尝试将类更改迁移到数据库并运行以下命令。但是,我在运行时收到错误消息Enable-Migrations -ContextTypeName MyMvc.Models.UsersContext?
PM> Enable-Migrations
More than one context type was found in the assembly 'MyMvc'.
To enable migrations for MyMvc.Models.UsersContext, use Enable-Migrations -ContextTypeName MyMvc.Models.UsersContext.
To enable migrations for MyMvc.Models.MyMvcContext, use Enable-Migrations -ContextTypeName MyMvc.Models.MyMvcContext.
PM> Enable-Migrations -ContextTypeName MyMvc.Models.UsersContext
Migrations have already been enabled in project 'MyMvc'. To overwrite the existing migrations configuration, use the -Force parameter.
更新:UsersContext我应该MyMvcContext在我的项目文件中
找到并替换所有内容吗?