Page 1 of 1

Initialize Dto classes from the constructor

Posted: Wed 04 Sep 2019 15:26
by PixelHunter
Hi!

I am using the DTO template to generate DTO classes when needed, however, I cannot find an option to initialize the related properties (mainly when they are lists) from the constructor.

Is there a way to do that?
For example, something like this:

Code: Select all

 
 public partial class ModelDto
    {
        public ModelDto()
        {
            this.CollectionExample= new List<CollectionExampleDTO>();
        }
        
        public List<CollectionExampleDTO> CollectionExample{ get; set; }
    }
    
Thanks in advance!

Re: Initialize Dto classes from the constructor

Posted: Thu 05 Sep 2019 17:07
by Shalex
We will implement the corresponding option in the Data Transfer Object template and notify you about the result.

Re: Initialize Dto classes from the constructor

Posted: Fri 06 Sep 2019 08:40
by PixelHunter
Cool! Thank you!