Repository pattern: One repository class for each entity?

前端 未结 4 1091
忘掉有多难
忘掉有多难 2020-12-05 00:50

Say you have the following entities defined in a LINQ class:

Product
Customer
Category

Should I have one repository class for all:

4条回答
  •  醉梦人生
    2020-12-05 01:10

    Basically there will be one repository per aggregate root object. There are some interesting points about DDD and aggregate root object and how we should design repository classes in the book ASP.NET MVC 2 in Action, look at it if you want to know more.

提交回复
热议问题