Multiple generic repositories in unitofwork?

后端 未结 3 1394
南笙
南笙 2021-01-07 05:38

Lets say I have 2 tables. ProductCategory and Product. I have 1 generic repository that can handle both tables:

public class Generi         


        
3条回答
  •  死守一世寂寞
    2021-01-07 05:52

    There are many ways to implement Unit of work. I prefer having the repositories take a Unit of Work in its constructor (which is passed via Dependency Injection), then you only create repositories for your needs.

提交回复
热议问题