I am trying to make this rest endpoint: /api/Offers/{offerId}/comments
, what is better in design view?
CommentRepository
and OfferRepository
inside OfferService
ORCommentService
and OfferService
inside OfferController
It is sort of specific to general issue, I don't know what is most recommended approach!
I would pick the second variant:
using CommentService and OfferService inside OfferController
There is no special reason for that, but for me its clearer, other than the repositories. (Only my Opinion)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.