MVC3 and Entity Framework

前端 未结 3 1424
不知归路
不知归路 2020-11-22 11:30

My question is pretty simple: is it a good practice to place the .edmx file in the model folder in a Web application of an MVC3 project?

3条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 11:55

    I agree with Davide here completely I just want to add that you should also consider using the POCO templates to generate poco objects and not return entity framework objects to another layer because it then puts a dependency on the entity framework.

    At some inevitable point if you don't pluck this out into a separate project, your direct data access code ends up thrown into your web code. I see it all the time (and we've all been guilty of it at some time)

提交回复
热议问题