The problem with constructor

Posts   
 
    
seacat
User
Posts: 9
Joined: 26-Jan-2007
# Posted on: 20-Feb-2007 11:53:17   

Hi guys, I have a little table with 1 key field, but my entity doesn't contain any constructor to load the entity from database into memory. That is my table HelpTopics has fields: TopicId (PK), Title, Text. I would like to get Entity like that:

HelpTopicEntity hlp = new HelpTopicEntity(5);
.... 
hlp.Save();

But my HelpTopicEntity has not constructor like HelpTopicEntity(int TopicId) !!! What's wrong? Thanx

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 20-Feb-2007 14:19:54   

I have seen this question rasied before. 1st, what build are you using for ORM, code generator? If you haven't updated your libraries in a couple months there have been many revs.

2nd, Add a second "dummy" field to the table, re-gen the code and see if the constructor is formed. I think there was a issue with single column tables in previous versions.

3rd, search the forums for "constructor" and see if any of the results match your issue.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 21-Feb-2007 09:40:21   

Check if the entity has a PK in the designer. If not, you won't get that constructor.

Frans Bouma | Lead developer LLBLGen Pro