C#项目文件夹的命名规则 [英] C# Project folder naming conventions

查看:893
本文介绍了C#项目文件夹的命名规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个所谓的数据项目,这是一个数据层。在这个项目中,所有文件都只是趴在上面的文件夹。我有枚举,波苏斯,仓库,部分类等。

I have a project called Data which is a data layer. In this project, all files are just lying in the top folder. I have enumerations, POCOs, repositories, partial classes and so on.

如果我希望将这些文件移动到子文件夹,这将是为每个文件夹的preffered文件夹名称?有什么约定?

If i want to move those files into subfolders, what would be the preffered folder name for each folder? Is there any convention?

在库文件夹是pretty的明显,但我应该在哪里保持波苏斯和枚举?

The "Repositories" folder is pretty obvious, but where should i keep POCOs and enumerations?

感谢

推荐答案

我倾向于使用项目文件夹,分离出子名字空间的一种方式。所以,你的情况,也许是一个名为库的文件夹,里面有在Data.Repositories命名空间中的类。注意,对于部分类,每一个文件需要在相同的命名空间。

I tend to use project folders as a way of separating out sub namespaces. So in your case, perhaps a folder called Repositories, which has class in the Data.Repositories namespace. Note, for partial classes, each file needs to be in the same namespace.

这篇关于C#项目文件夹的命名规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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