使用代码强制edmx更新/重新生成 [英] Force edmx update/re-generation with code

查看:71
本文介绍了使用代码强制edmx更新/重新生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有自动化测试套件。我希望在那里实施EF6。我的问题是:


我有一些测试环境。大多数情况下我只使用1,所以在我的本地版本上,我可以自己动手更新它们,但是当在TeamCity上构建项目时,它几乎不是一个好的选择。我想确保每个人都可以为每个
环境运行完整版本的TC,而无需手动重新生成.edmx并将其推回到主分支。 


让我们比方说,每个环境都有3个DB,所以我现在要做的就是创建3个.edmx,然后当项目构建启动时,我将强制.edmx在当前环境下更新,在任何测试开始之前运行。


另一种选择是为每个环境存储3个.edmx(显然它是最不利的变体),但我仍然需要知道如何告诉我的.edmx他们需要更新。

解决方案

IMO, 在你谈到的最后一个实际上工作的唯一一个是谈论EDMX和相关的代码库匹配 对于从手动方面完成的每个环境。 


而且我知道,没有什么可以通知EDMX它需要更新,就像你可以'用源代码了解 它必须通知代码库中的另一个相关环境源代码,它需要更新其代码库
。    


I have Automated Test suite. I want implement there EF6. My problem is:

I have some test environments. Mostly i use only 1, so on my local version i can afford my self to update them manually, but it hardly is a good option when project is built on TeamCity. I want to make sure that everyone can run full build with TC for every environment, without manually regenerating .edmx`s and pushing them back to master branch. 

Lets say, each environment has 3 DB, so what i would like to do right now is to create 3 .edmx and then when project is build is launched i will force .edmx`s to update according to current environment, before any test started to run.

The other option is to store 3 .edmx for each environment (obviously it is the least favorable variant), but still i need to know how can i tell my .edmx that they need to be updated.

解决方案

IMO,  the only one that is actually going to work in the last one you talk about that is talking about an EDMX and related code base that matches  for each environment that is being done from a manual aspect. 

And that I know about, there is nothing that is going notify an EDMX that it needs updating, just like you can't do it with source code knowing  that it has to notify another related environment source code in the code repository that it needs to update its code base.    


这篇关于使用代码强制edmx更新/重新生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆