ASP.NET MVC 模型设计和迁移
我正准备开始设计一个 ASP.NET MVC Web 应用程序,并计划使用模型设计器来创建对象,然后 ASP.NET 使用指定的数据库系统(SQLite、MSSQL 或其他)自动、透明地创建这些模型。 ...)。
我试图找到相关信息,但由于我是法国人,所以对我来说没有什么真正清楚的,如果我的问题已经在某个地方被问到,那么很抱歉。我将非常感谢任何帮助。
所以问题是,当我在添加功能、改进应用程序工作流程等后需要迁移对象和数据时,ASP.NET MVC 将如何管理迁移?我想我需要使用一些迁移框架,例如 MigratorDotNet ?但是这个问题例如:它需要指定字段和表作为迁移指令,而 ASP.NET MVC 旨在透明地管理这一切。
我希望我解释得很好。 非常感谢您的帮助!
编辑 : 我想问的具体且可能更简单的是: 是否可以根据通过模型设计器进行的先前模型设计和新模型设计之间的比较来自动进行应用程序模型迁移?如果是,怎么办?多谢 !
编辑2: 我想我在本页的“第 5 步:更改我们的模型”中找到了一些答案: http:// /weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx 使用Application_Start() 处理程序上的 Database.SetInitializer() 调用。
编辑3: 我可能终于找到了我的解决方案,实体设计器数据库生成电源包在这里解释:http://blog。 bareobjects.net/?p=137
有人已经尝试在生产中使用它吗?谢谢 !
I'm preparing to start designing an ASP.NET MVC web application and plan to use the model designer to create objects which models will then be automatically and transprently created by ASP.NET using a specified database system (SQLite, or MSSQL, or other...).
I tried to find information about that, but nothing really clear for me as I am french, so sorry if my question were already asked somewhere. I would be very grateful for any help.
So the problem is, when I will need to migrate objects and data after adding features, improved the application workflow, etc..., how will ASP.NET MVC can manage the migration ? I guess I would need to use some migration framework such as MigratorDotNet ? But problem with this one for example : it needs to specify fields and tables as migration instructions, while ASP.NET MVC is intended to manage it all transparently.
I hope I explained well.
Thank you very much for your help !
EDIT :
What I wanted to ask, specifically and may be more simply is :
Is it possible to make my application model migration quite automatically based on comparison between previous and new model design made through the model designer ? If yes, how ? Thanks a lot !
EDIT 2 :
I think I found some answer on "Step 5: Changing our Model" of this page :
http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx using Database.SetInitializer() call on the Application_Start() handler.
EDIT 3:
I may have finally found my solution, the Entity Designer Database Generation Power Pack explained here : http://blog.nakedobjects.net/?p=137
Did anyone already try and use it in production ? Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,我认为这是我将采用的解决方案:
http:// /blogs.msdn.com/b/adonet/archive/2010/02/08/entity-designer-database- Generation-power-pack.aspx
我希望这对任何人都有用 将来 !
Finally, I think this is the solution I will adopt :
http://blogs.msdn.com/b/adonet/archive/2010/02/08/entity-designer-database-generation-power-pack.aspx
I hope this will be usefull to anyone in the future !