Should A repository call another repository? Or should a repository call a service layer?

后端 未结 2 1635
小鲜肉
小鲜肉 2020-12-16 19:54

I am trying to figure out how to tackle this problem. I have to insert some data into 2 tables lets call them Table A and Table B.

Table A has these columns
         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 20:32

    The guard clause (param1 != "hi") should be in a higher layer, such as an application service layer.

    The service layer should coordinate the two repositories.

提交回复
热议问题