Problem with generated contructor

Posts   
 
    
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 15-Dec-2006 03:58:07   

I am having problems with some generated subtype entities. The no-parameter constructor for these subtypes is not setting the LLBLGenProEntityName to the name of the subtype...all the constructors that take parameters call SetName(...) but the default constructor does not. This is due to the template code:


        ''' <summary>CTor</summary>
        <[If IsAbstract]>Friend<[Else]>Public<[EndIf]> Sub New()
<[If Not IsSubType]>            MyBase.New("<[CurrentEntityName]>Entity")
            InitClassEmpty(CreateValidator(), CreateFields())<[EndIf]>
        End Sub

Is this missing a call to SetName?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Dec-2006 09:39:58   

I guess you are using old templates.

Mine have the following:

<[If IsAbstract]>Friend<[Else]>Public<[EndIf]> Sub New()
<[If IsSubType]>            SetName("<[CurrentEntityName]>Entity")
<[Else]>            MyBase.New("<[CurrentEntityName]>Entity")
            InitClassEmpty(CreateValidator(), CreateFields())<[EndIf]>
        End Sub

Please download the latest release of LLBLGen Pro

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 15-Dec-2006 10:01:02   

That indeed was a bug, as Walaa said your templates are outdated. Please update to the latest templates simple_smile

Frans Bouma | Lead developer LLBLGen Pro
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 15-Dec-2006 21:07:37   

I got that template from the customer area, Downloads for LLBLGen Pro v1.0.2005.1, Tasks and templates section. It says it is build 06212006... disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 16-Dec-2006 13:00:32   

mikeg22 wrote:

I got that template from the customer area, Downloads for LLBLGen Pro v1.0.2005.1, Tasks and templates section. It says it is build 06212006... disappointed

Ok, the bug I was talking about was in the 2.0 templates. So this is a different thing. I'll look into it, as it's a bug in the templates.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 19-Dec-2006 11:19:19   

I've fixed the issue. It's now available in the 1.0.2005.1 section, tasks and templates.

Frans Bouma | Lead developer LLBLGen Pro
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 19-Dec-2006 18:34:55   

Otis wrote:

I've fixed the issue. It's now available in the 1.0.2005.1 section, tasks and templates.

Thanks simple_smile