英文:
Migrate from Entity Framework 6 to Entity Framework Core (ASP.NET MVC5 project to Blazor WebAssembly(.NET Core Hosted))
问题
你好大家
这是我的情况,我被分配了一个任务,要维护和更新一个之前一名离职开发人员开发的项目,我被聘用来取代他,不幸的是,我们没有见面,因为他已经离职三个月了。现在我必须维护他的项目,他的代码很干净且易于维护,现在我们有一个项目,需要将我们的系统从ASP.NET MVC 5更新到ASP.NET Core或.NET 6。所有的项目都在使用Entity Framework,而我只有在Entity Framework Core上开发的经验,因为在.NET Framework时代我使用的是ADO.NET。现在所有项目的数据库都是在Entity Framework中使用Code First的,并且有相应的迁移历史记录。对于项目,我打算在Blazor WebAssembly(.Net Core Hosted)上重新编写它,并且我想使用现有的数据库,但我没有从Entity Framework 6迁移到Entity Framework Core的经验,我想尝试数据库优先的方法,但当我想使用迁移来更新数据库时可能会出问题。
此外,数据库还包含了Identity/AspNetUsers。
有人能教我对于这个情况什么是最佳的方法吗?
谢谢,问候。
我打算使用数据库优先的方法,但这可能不会生成迁移文件。
英文:
Good day everyone
Here's my scenario, I was given a task to maintain and update a project that was developed by a previously resigned developer, which I was hired to be his replace, unfortunately, we didn't meet as he was resigned for 3 months now, Now I have to maintain his project which fine with and his code is clean and maintainable, now we have project to update our system from ASP.NET MVC 5 to ASP.NET Core or .NET 6. all of the projects are using Entity Framework, for me, I only have experience on developing on Entity Framework Core, as I'm using ADO.NET during my .NET Framework days. Now all of the project's databases are code first in entity framework and has a migration history with it, for projects, I will recode it on Blazor WebAssembly (.Net Core Hosted), and I want to use the existing database, but I have no experience on migrating from Entity Framework 6 to Entity Framework Core, I want to try the database first approach, but this might cause a problem when I want to update the database using Migration.
Also, the database has also had an Identity/AspNetUsers
Can someone teach me on what's the best approach for this?
Thanks, and regards.
I'm planning to use database first but this might not get the migration files.
答案1
得分: 0
对于将 EF 6 数据库首先迁移到 EF Core 应用程序,我建议您可以参考这篇文章。
>另外,数据库还具有 Identity/AspNetUsers。另外,数据库还具有 Identity/AspNetUsers。
对于将身份验证和身份迁移到 ASP.NET Core,我建议您可以遵循这篇文章。
英文:
For migrating the EF 6 database first to EF core application, I suggest you could refer to this article.
>Also, the database has also had an Identity/AspNetUsers,Also, the database has also had an Identity/AspNetUsers
For migrating authentication and identity to ASP.NET core, I suggest you could follow this article.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论