Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • What would you gain from the first option? I would suggest the second solution, which is much cleaner IMO, and as you say, doesn't unnecessarily use up database resources. Commented Jun 6, 2021 at 17:20
  • @SebastianSotto The only problem I see with that approach is that I'd be validating DTOs in the service layer. Or should those validations over the DTO be made in the controller layer? (As asked in the last paragraph) Commented Jun 6, 2021 at 18:58
  • 1
    I see no problem whatsoever in having some validation in the Service layer. Commented Jun 7, 2021 at 9:34