In separate data access & business logic layer, can I use Entity framework classes in business layer?

后端 未结 3 1525
执念已碎
执念已碎 2020-12-14 03:41

In separate data access & business logic layer, can I use Entity framework classes in business layer?

EDIT: I don\'t think I will need to swap out the data acces

3条回答
  •  囚心锁ツ
    2020-12-14 04:33

    As with all questions of this nature the answer is it depends. If you want a clear seperation of your data access logic and business layer I would say no. If that is what you are aiming for I would use a repository pattern and IoC to build the data access layer then you can swap in a stub DAL for unit testing purposes and then bring in the database access when you get to the functional testing.

提交回复
热议问题