English 中文(简体)
EF 4法如何首先处理生产环境的化学变化?
原标题:How does EF 4 code first handle schema changes in a production environment?

传统上,我总是用手写我的手稿,这样,这些文字是冰和干净的(不是产生文字的狂热),并且释放出来,我提供了新安装的文字和前版本的移民文字,这些文字产生了新的表格,改变了现有的表格等。 这是完全的标准。

我没有多少时间首先用第4号欧洲法郎法进行操作,但如果在生产环境中实际可行,我很有兴趣使用。

如果不存在一个数据库,你首先采用一种代码方法。 如果你释放了新版本的软件,则会发生什么变化。 EF是否足以更新数据库图示,使之与最新电子格式相匹配?

<>Scenario

  1. Client installs asp.net MVC website on their server. Upon first run, a fresh database is created
  2. Client uses website for a while and the database gets populated with some data
  3. Meanwhile a new version of the website is released and the EF model has changed
  4. Client downloads new version, deploys website and points to existing database

www.un.org/Depts/DGACM/index_spanish.htm 守则是否首先对初步部署有用,或者它是否足以更新现有的数据库,以便发布这样的信息?

最佳回答

至于EFCTP4,每当你改变目标模式时,都会放弃和重新启用你的数据库(这不是违约公约,你必须明确告诉欧洲复兴开发银行第一部通过建立数据库初步战略这样做)。

尽管如此,欧洲复兴开发银行小组正在积极开展以下工作:Database Evolution (aka Migrations) Solutions<>>>><>>><>>>>>>。 这完全涉及你的假设情景:A 解决办法,随着时间的推移,将数据库表化,作为你的标本模型的改动。

按照欧洲复兴开发银行小组,这一特点将作为欧洲复兴开发银行下一版的一部分提供,该版本将于2011年第一季度公布。

问题回答

我正在开发数据库背景初步分析器,如果模型和 d化chem脱.,将通知网络主管。 这对希望完全控制代码第一模型和数据库图谱的开发商来说是有益的。 检查:

https://github.com/rialib/efextensions”rel=“nofollow>https://github.com/rialib/efextensions

利用EF 6 , u 能够重新设计你的数据库(代码一),确保安装所有更新设备,有时u 在现有数据库中可能有不同的图象,在你的背景类别中使用。

 modelBuilder.Entity<Charge>().ToTable("FullDepot.Charge");

如果你只选取<条码>dbo.yourtable,而不是像FullDepot.secondtable等表格。 等等





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...