POCO Class generation name change

Posts   
 
    
NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 06-Aug-2014 11:21:56   

Hi,

Is it possible to change the default name of the generated POCO so it doesn't have 'Row' tagged onto the end?

I've seen the setting for 'Typed view row base class name default', would it be something like {$TypedViewName}POCO etc?

What's the correct syntax? it ignored what I tried above and can't find any info in the help files?

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Aug-2014 19:20:08   

Which version of LLBLGen are you using? Are you speaking about the Entities POCO classes?

NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 07-Aug-2014 10:49:49   

Walaa wrote:

Which version of LLBLGen are you using? Are you speaking about the Entities POCO classes?

Hi,

I'm using 4.2 (July 25th, 2014) 4.2.14.0725, this feature was introduced in 4.2.

I don't think you can generate POCO's from entities (would be handy)? this is for TypedView POCO generation (see attached).

Thanks.

NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 07-Aug-2014 13:20:44   

Big thumbs up for the POCO addition btw, really easy to use. Tested serializing over WCF, all works nicely. Nice smile


public List<VOwnerRow> GetOwners()
        {

            try
            {
                var qf = new QueryFactory();
                var q = qf.VOwner.Where(VOwnerFields.CntId == "THA").CacheResultset(_defCacheExpiry);
                var results = new DataAccessAdapter().FetchQuery(q);
                return results;
            }

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Aug-2014 17:13:53   

Nothing was attached to your message.

Anyway, you'll need to edit the corresponding template, to remove the poco phrase.

NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 07-Aug-2014 17:16:01   

Walaa wrote:

Nothing was attached to your message.

Anyway, you'll need to edit the corresponding template, to remove the poco phrase.

disappointed

Ummm,

Could you provide some details on which template it is? I have attached the image.

Attachments
Filename File size Added on Approval
Project properties.png 50,256 07-Aug-2014 17:16.23 Approved
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Aug-2014 17:26:50   

For LLBLGen Framework, I think this is what you are looking for: [Solution Design Installation Folder]\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListRowClass.lpt(39)

NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 07-Aug-2014 17:29:46   

Walaa wrote:

For LLBLGen Framework, I think this is what you are looking for: [Solution Design Installation Folder]\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListRowClass.lpt(39)

Thanks.

So what are the fields below the Output Type combo for? Seems a shame to have to edit the default template, you'd have to do it on each machine that has LLBLGen installed.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Aug-2014 17:35:32   

Well, currently, this option is not configurable. . Have your own version of that template along with any other custom template, with the needed presets and distribute them through source control.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Aug-2014 09:44:14   

NMackay wrote:

Walaa wrote:

For LLBLGen Framework, I think this is what you are looking for: [Solution Design Installation Folder]\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListRowClass.lpt(39)

Thanks.

So what are the fields below the Output Type combo for? Seems a shame to have to edit the default template, you'd have to do it on each machine that has LLBLGen installed.

Which fields exactly are you referring to btw? simple_smile

The 'Row' is present in the name as the class doesn't represent the list/view, it represents a row in the list/view, so to avoid confusion what the class stands for, the 'Row' suffix was added.

NMackay wrote:

Big thumbs up for the POCO addition btw, really easy to use. Tested serializing over WCF, all works nicely. Nice smile


public List<VOwnerRow> GetOwners()
        {

            try
            {
                var qf = new QueryFactory();
                var q = qf.VOwner.Where(VOwnerFields.CntId == "THA").CacheResultset(_defCacheExpiry);
                var results = new DataAccessAdapter().FetchQuery(q);
                return results;
            }

Thanks simple_smile It was long overdue, generating to pocos. The read/only nature is a natural fit for services indeed simple_smile

Frans Bouma | Lead developer LLBLGen Pro
NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 08-Aug-2014 09:57:05   

Otis wrote:

NMackay wrote:

Walaa wrote:

For LLBLGen Framework, I think this is what you are looking for: [Solution Design Installation Folder]\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListRowClass.lpt(39)

Thanks.

So what are the fields below the Output Type combo for? Seems a shame to have to edit the default template, you'd have to do it on each machine that has LLBLGen installed.

Which fields exactly are you referring to? simple_smile

The 'Row' is present in the name as the class doesn't represent the list/view, it represents a row in the list/view, so to avoid confusion what the class stands for, the 'Row' suffix was added.

Hi Frans,

See attached for the fields I was referring to (marked in red).

I fully understand why you called it row, we do expose these TypedView's as POCO for web services and we need to a more friendly name basically (we have to provide WSDL for some of our Java integrators). The row bit would just confuse some of them (trust me) simple_smile

It's a excellent addition to the product, the Collapse all in the designer is very welcome.

Attachments
Filename File size Added on Approval
Project properties.png 50,256 08-Aug-2014 09:57.23 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Aug-2014 10:17:52   

NMackay wrote:

Otis wrote:

NMackay wrote:

Walaa wrote:

For LLBLGen Framework, I think this is what you are looking for: [Solution Design Installation Folder]\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListRowClass.lpt(39)

Thanks.

So what are the fields below the Output Type combo for? Seems a shame to have to edit the default template, you'd have to do it on each machine that has LLBLGen installed.

Which fields exactly are you referring to? simple_smile

The 'Row' is present in the name as the class doesn't represent the list/view, it represents a row in the list/view, so to avoid confusion what the class stands for, the 'Row' suffix was added.

Hi Frans,

See attached for the fields I was referring to (marked in red).

ah! Those are for the base class to use for the generated poco classes, so if you want to have a poco class to derive from some other class you can do so by specifying the base class name. THe default is used to specify it for all poco classes, and you can override this default at the element level.

I fully understand why you called it row, we do expose these TypedView's as POCO for web services and we need to a more friendly name basically (we have to provide WSDL for some of our Java integrators). The row bit would just confuse some of them (trust me) simple_smile

It's a excellent addition to the product, the Collapse all in the designer is very welcome.

simple_smile

Frans Bouma | Lead developer LLBLGen Pro
NMackay
User
Posts: 138
Joined: 31-Oct-2011
# Posted on: 08-Aug-2014 10:34:45   

Cool,

That could be handy down the line.

Thanks for clearing that up.

We'll just edit the template as Walaa suggested for now. It would be nice if you could override the name generation with a designer setting but it's not a biggie.