Initialize Dto classes from the constructor

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
PixelHunter
Posts: 17
Joined: Thu 29 Jun 2017 11:07

Initialize Dto classes from the constructor

Post by PixelHunter » Wed 04 Sep 2019 15:26

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!

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Initialize Dto classes from the constructor

Post by Shalex » Thu 05 Sep 2019 17:07

We will implement the corresponding option in the Data Transfer Object template and notify you about the result.

PixelHunter
Posts: 17
Joined: Thu 29 Jun 2017 11:07

Re: Initialize Dto classes from the constructor

Post by PixelHunter » Fri 06 Sep 2019 08:40

Cool! Thank you!

Post Reply