Difference between repository and service?

前端 未结 3 881
醉话见心
醉话见心 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条回答
  •  Happy的楠姐
    2020-12-12 10:49

    The repository is where the data is stored. The service is what manipulates the data.

    In a real-world situation comparison, if your money is stored in a vault in a bank, the vault is the repository. The teller that deposits, withdraws, etc is the service.

提交回复
热议问题