title: Dto to entity and dto from entity
body: <p>In my app I need multi times map from the Entity (Database model) to DTO (local object)</p>
  <p>Most times, Dto have the same names as the entity</p>
  <p>For example The Entity</p>
  <pre><code>export class CompanyModel extends BaseEntity {
    constructor(init?: Partial&lt;CompanyModel&gt;) {
    }
    @PrimaryGeneratedColumn('uuid')
    id: string;
  
    @Column({ length: 500 })
    name: string;
  
    @Column({ length: 500, unique: true })
    email: string;
  
  
  
  
    ....
  
  }
  </code></pre>
  <p>The DTO</p>
  <pre><code>export class Company {
    @ApiProperty()
    id: string;
  
  
    @ApiProperty()
    email: string;
  
    @ApiProperty()
    name: string;
  ...
  }
  </code></pre>
  <p>Now I add static function <code>toModel</code> and <code>fromModel</code></p>
  <pre><code>  static toModel(companyDto :CreateCompanyDto ) : CompanyModel {
      const companyModel =  new CompanyModel();
  
      const {name, email,..... } = companyDto;
      companyModel.name = name;
      companyModel.email =email
     
  .....
      return companyModel;
  }
  </code></pre>
  <p>What is the best solution for mapping DTO to ENTITY in nestjs / node</p>