ASP.NET MVC 2 RC 区域和共享模型

发布于 2024-08-20 03:40:35 字数 218 浏览 3 评论 0原文

通过 Visual Studio 上下文菜单创建新区域后,将出现三个文件夹:控制器、模型、视图。是不是每个区域都应该有自己的模型类?或者所有区域在根 Models 文件夹中共享相同的模型类是否可以接受/广泛使用/有好处?

我的项目不同于域模型和视图模型,因此 Models 文件夹包含视图模型。

是的,多个区域的多个视图似乎以某种方式共享相同的视图模型。

Once new area is created by the means of Visual Studio context menu, there are three folders: Controllers, Models, Views. Is it supposed that every area should have it's own model classes? Or is it acceptable/widely-used/good for all areas to share the same model classes in the root Models folder?

My project differs Domain Model and View Model, so Models folder contain View Models.

And yes, several views of several areas seems to share the same View-Models some way.

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

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

发布评论

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

评论(1

滥情空心 2024-08-27 03:40:35

如果您的视图模型被多个区域共享,请将它们放入 ~/Models - 对此没有任何限制

If your View Models are shared by several Areas, put them into ~/Models - there is no any restiriction on that

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