Dal (with Entity Framework) and Model layers into MVC

后端 未结 4 827
半阙折子戏
半阙折子戏 2021-01-15 02:52

First of all , I use EF into Dal layer (separeted project from MVC, same solution). The generated models from EF\'s EDMX file are the actual models from

4条回答
  •  庸人自扰
    2021-01-15 03:12

    You are right in your idea of not accessing access the Models in your DAL directly from your presentation layer.

    To avoid duplicating code when translating your DAL objects into the Models used by your views, you could use something like AutoMapper, which is supposed to do the heavylifting for you in exactly that scenario.

提交回复
热议问题