Difference between repository and service?

前端 未结 3 886
醉话见心
醉话见心 2020-12-12 10:28

What\'s the difference between a repository and a service? I don\'t seem to grasp it.

I\'m talking about data access through a data access layer, typically with linq

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 10:30

    I would say as a first try, in the general sense (until you give more context if you have one):

    • a repository is where you place some global objects, to be used later.
    • a service is a business logic code, made explicit (and ideally separated from the Presentation layer, and database layer ?)

提交回复
热议问题