Dal (with Entity Framework) and Model layers into MVC

后端 未结 4 796
半阙折子戏
半阙折子戏 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 02:58

    I may be mistaking but to me, using generation from EDMX provides you with the DbContext which could be considered as the DAL and entities which could be considered as the Model.

    So you might directly manipulate entity instances as your business object. Manipulation of the base through the DbContext should appear in the BLL layer. Additionally, you might implement DTOs where needed.

    This, of course, assumes you want to use entity framework code generation. Other options like using POCOs might be more relevant considering your overall architecture.

提交回复
热议问题