How to generate class code with automatic properties

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
stan4th
Posts: 2
Joined: Tue 25 Sep 2012 16:25

How to generate class code with automatic properties

Post by stan4th » Tue 25 Sep 2012 16:32

Hi,
when generating nHibernate class code how can I set it to generate properties using automatic properties?
e.g.

Code: Select all

public virtual string Surname { get; set; }
Thanks

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

Re: How to generate class code with automatic properties

Post by Shalex » Thu 27 Sep 2012 16:01

Our code generation requires complete (not automatic) properties.
If you need automatic properties, please modify template with a built-in T4 Editor of Entity Developer.

stan4th
Posts: 2
Joined: Tue 25 Sep 2012 16:25

Re: How to generate class code with automatic properties

Post by stan4th » Fri 19 Oct 2012 09:02

Hi Shalex,
could you direct me to where I need to look for instructions on this please?
Many thanks,
John

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

Re: How to generate class code with automatic properties

Post by Shalex » Tue 23 Oct 2012 16:13

Save the model, right click on the template in Model Explorer > Copy to Model Folder. Then double click the template, find the code which generates the properties (the GenerateProperty method) and modify it correspondingly to meet your requirements.

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

Re: How to generate class code with automatic properties

Post by Shalex » Tue 29 Jan 2013 17:14

The behaviour is changed: .NET auto-properties are generated in code if both Property ChangeNotifiers and Property Change Partial Methods properties of a template are set to False. We will post here when the corresponding build of Entity Developer is available for download.

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

Re: How to generate class code with automatic properties

Post by Shalex » Thu 07 Feb 2013 12:41

New build of Entity Developer 5.0.43 is available!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=25825.

Post Reply