---
title: "Comment by Ivan Ivan on \"Enhancing Code Reusability with NestJS Abstract Repository Pattern Best Practices and Examples\" | Hashnode"
description: "Hello, how about dto? what if we want some properties to be required and others to be optional, how do we validate them with class-validator etc?"
url: "https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f/comment/678770f92f84406d23f4784a"
---

[Discussion](https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f)

Comment [Enhancing Code Reusability with NestJS Abstract Repository Pattern Best Practices and Examples](https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f)

[Ivan Ivan](https://hashnode.com/@retouch)

[Jan 15, 2025](https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f/comment/678770f92f84406d23f4784a)

Hello, how about dto? what if we want some properties to be required and others to be optional, how do we validate them with class-validator etc?
