ASP.NET MVC 视图可以在不同的项目中重复使用吗?

发布于 2024-08-19 14:08:30 字数 484 浏览 3 评论 0原文

这是此问题的后续问题 问题

这是使用源代码管理在多个项目之间共享公共视图的一个很好的解决方案。不过我有几个问题,我认为是针对 Subversion 的。

Subversion externals 允许您在工作副本中包含来自单独存储库的文件夹,因此您可以在添加文件夹的工作副本根目录上定义“外部”属性:例如 [/Web/Views/Forum]。

  1. 如果您想使用特定于依赖项目之一的版本覆盖这些视图之一,会发生什么情况?
  2. 如果您在该文件夹中添加了额外的视图,SVN 会将其提交到共享存储库吗?

现阶段的答案是“等待 MVC2”吗?我认为它对于此类场景更好?

谢谢, 气相色谱

This is a follow-up question to this question.

It's a nice solution to sharing common Views across many projects using source control. However I have a couple of questions, specific to Subversion I think.

Subversion Externals allows you to include a folder from a separate repository in your working copy, so you could define an "External" property on the working copy root that added a folder: [/Web/Views/Forum] for example.

  1. What would happen if you wanted to override one of these views with a version specific to one of the dependant projects?
  2. If you added an additional View in that folder, would SVN commit it to the shared repository?

Is the answer at this stage "wait for MVC2", as I believe it is better for these kind of scenarios?

Thanks,
GC

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回心转意 2024-08-26 14:08:30

svn:externals 不是您问题的答案

只是为了澄清:使用 svn:externals 时,您实际上是在添加指向实际外部存储库的链接。无论您从工作副本修改/添加/删除和提交(假设您具有对外部存储库的提交访问权限),都将简单地提交到该存储库。使用相同存储库(无论是否为外部存储库)的其他人都将在后续更新中获得这些更改。

如果您确实需要能够修改视图,则必须制定分支和分支。恐怕是合并计划。如果是这样的话,请确保这确实值得。

编辑:作为原始问题的答案,我认为最好的选择是等待 ASP.Net MVC 2。您可能想看看 Eric Hexter 的这一系列博客文章,解释“可移植区域” ' 使用 mvc2 和 mvccontrib

svn:externals are not the answer to your problem

Just to clarify: when using svn:externals, you're really adding a link to the actual external repository. Whatever you modify/add/delete and commit (given that you have commit access to the external repository) from your working copy will simply get committed to that repository. Everyone else using the same repo (as external or not) will get those changes on a subsequent update.

If you really need to be able to modify the views, you will have to work out a branching & merging scheme I'm afraid. If that is the case, make sure it's really worth the trouble.

EDIT: As an answer to the original question, I think your best bet is to wait for ASP.Net MVC 2. You may want to have a look at this series of blog posts by Eric Hexter, explaining 'Portable Areas' with mvc2 and mvccontrib

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文