目前我正在尝试寻找一种使用 EF core 2.2 进行数据迁移的方法。阅读说明后: https ://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/
我意识到它只支持 DbContext。目前,在我的项目中,我的数据库有 mongoDBContext 和 IMongoDBContext ,但找不到任何支持它们的包。我也尝试使用Microsoft.EntityFrameworkCore.Design
,但没有帮助。有什么解决方案可以让我使用 mongoDbContext 作为数据库提供者,或者任何支持 mongoDB 作为数据库提供者的包?
至于我尝试创建迁移文件,尽管没有 DbContext:
从我的终端
dotnet ef migrations add InitialCreate
错误
No DbContext was found in assembly '.Data'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.
太感谢了!