放在哪里实体框架数据模型MVC应用程序?

问题描述:

让我们考虑默认的ASP.NET MVC应用程序文件夹结构,所以它看起来是这样的:

Lets consider default ASP.NET MVC application folder structure, so it's looks like this:

-App_data
-Content
-Controllers
    HomeController.cs
-Models
    AccountModels.cs
-Scripts
-Views

我的问题是:哪里是把实体框架数据模型(EDMX)文件的最佳地点?它是模型文件夹?是的 - 我们知道,好的解决方案是引进新的项目和它引用MVC应用程序,但现在,让我们忘了这个

My question is: Where is the best place to put Entity Framework Data Model (EDMX) file? Is it Models folder? Yes - we know that good solution is to introduce new Project and reference it to MVC application, but lets forget about this now.

对于一个小项目,它应该是模型的一部分​​。对于较大的产品,所述储存库和关联的模型可以是在一个单独的组件。

For a small project, it should be part of the Model. For a larger product, the repository and the associated model could be in a separate assembly.