N 分层 MVC 项目问题

发布于 2024-09-25 03:53:40 字数 276 浏览 0 评论 0原文

我对 N 层 MVC 应用程序的外观感到有点困惑。我认为标准应该是:

ASP .NET MVC Project
Service Layer
Data Access Layer (containing repositories)

我对实体框架模型应该放在哪里(.edmx)感到困惑。它应该在数据访问层吗?实体的任何部分类是否应该位于服务层中?是否应该将任何部分类与 edmx 模型放在一起?

欢迎任何关于创建 n 分层应用程序的建议。

谢谢

I am getting a bit confused about how an N Layered MVC application should look. I am thinking as standard there should be:

ASP .NET MVC Project
Service Layer
Data Access Layer (containing repositories)

I am confused as to where the entity framework model should sit (.edmx). Should it be in the Data Access Layer? Should any partial classes of the entities sit in the service layer? Should any partial classes sit with the edmx model?

Any advise on creating n layered applications is welcomed.

Thanks

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

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

发布评论

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

评论(1

倾`听者〃 2024-10-02 03:53:40

我通常将实体框架 edmx 文件放在数据层中。我添加了一个名为 Repositories 的文件夹,并将存储库放入其中 - AppName.Data.Repositories

然后我有我的业务层(服务层),然后是我的 Web 项目(MVC)。

I usually put my Entity Framework edmx file in the Data Layer. I add a folder call Repositories, and put the repositories in there - AppName.Data.Repositories.

Then I have my Business Layer (Service Layer), and then my Web Project (MVC).

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