一个ViewModel应该从哪里坐在ASP.NET MVC应用程序的目录结构 [英] Where should a ViewModel sit in the directory structure of an ASP.NET MVC application

查看:100
本文介绍了一个ViewModel应该从哪里坐在ASP.NET MVC应用程序的目录结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个视图模型的一些数据传递给视图。因此,如果应用程序结构约定为主。凡应保存视图模型的定义。
我可以创建一个名为的ViewModels新的目录,但什么是正确的做法。

I am about to create a ViewModel to pass some data to a View. So if the application structure is convention based. Where are the ViewModel definitions to be kept. I could create a new directory called ViewModels, but what is the RIGHT way.

推荐答案

我不认为有一个被广泛接受的约定这一点。

I don't think there's a widely accepted convention for this.

我有'的ViewModels文件夹了。

I have 'ViewModels' folder too.

这篇关于一个ViewModel应该从哪里坐在ASP.NET MVC应用程序的目录结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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