ASP.NET MVC 2 RC 区域和共享模型
通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的视图模型被多个区域共享,请将它们放入
~/Models
- 对此没有任何限制If your View Models are shared by several Areas, put them into
~/Models
- there is no any restiriction on that