简体   繁体   English

正确的文件和文件夹布局 .NET MVC

[英]Proper file and folder layout .NET MVC

In my ASP.NET 4.8 MVC project, I have an infrastructure and models folders.在我的 ASP.NET 4.8 MVC 项目中,我有一个基础设施和模型文件夹。 What should go in each folder?每个文件夹中的go应该是什么?

For example, if I have a class named Car, would all properties, constructors, methods, everything related to a car go in a Car.cs file in the Models folder, or would some of it go in the Infrastructure folder?例如,如果我有一个名为 Car 的 class,所有属性、构造函数、方法以及与汽车 go 相关的所有内容都在 Models 文件夹中的 Car.cs 文件中,还是其中一些 go 在 Infrastructure 文件夹中?

Models - All the POCO classes which are used to create a table when using code first approach.模型 - 在使用代码优先方法时用于创建表的所有 POCO 类。

Infrastructure - Includes database repository interfaces and their implementations which will have methods that directly Add, Update, Delete records in database tables etc.基础设施——包括数据库存储库接口及其实现,它们将具有直接添加、更新、删除数据库表中记录等的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM