MVC DDD: Is it OK to use repositories together with services in the controller?

前端 未结 5 489
情歌与酒
情歌与酒 2020-12-31 15:51

most of the time in the service code I would have something like this:

public SomeService : ISomeService
{
    ISomeRepository someRepository;
    public Do(         


        
5条回答
  •  时光说笑
    2020-12-31 16:37

    Even with "rich domain model" you will still need a domain service for handling business logic which involves several entities. I have also never seen CRUD without some business logic, but in simple sample code. I'd always like to go Martin's route to keep my code straightforward.

提交回复
热议问题