VS 2005 Project Option

Posts   
 
    
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 27-Jul-2006 05:30:19   

Frans,

I knwo this was discussed a while back, but why when partial class opion is on, does llblgen not generate two files for each entity, 1 being, AddressEntity.generated.cs and AddressEntity.cs and then make them dependant in the project file so you get a nice clean project for modifying the entities??

Seems like your not taking advantage of the goodies VS 2005 has to offer for code generation. wink

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 27-Jul-2006 06:18:56   

Yes, this would be very nice indeed!!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Jul-2006 06:48:34   

People may need the partial keyword to exist for any future enhancements or additions but they might want not to have those classes generated automatically for them unless they do need to create them.

And for those who want to generate those classes as well, please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6191

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 27-Jul-2006 07:52:12   

What about modifying the project file so that it shows the partial class, where it can be expanded and see the entityclass.gen.cs file if need be.

Any ideas there?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Jul-2006 11:00:25   

To do that, you need a modified ProjectFileCreator task performer, which adds the generated files as dependent nodes in the XML of the vs.net project instead of just as new nodes to the XML.

You then need 2 tasks: one to generate the partial classes one to modify the vs.net project file using the modified projectfilecreator task performer.

One reason I didn't add this was that it would create the same burden two-class scenario had as well in v1.x before user code regions were added: it can't overwrite the file if it's there. This is ok to get started, but if you have a large project and your entities are modified/renamed, it can be a challenge to update the project file.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 27-Jul-2006 16:26:51   

Would be nice if when I added files to a project in VS2005, I could make them dependent nodes to an existing file or vice versa...

That is really what I was after - If I have 50 entities in the 'EntityClasses' folder, I then make partial classes for half of them - now there are 75 files in this folder....

pilotboba
User
Posts: 434
Joined: 05-Aug-2005
# Posted on: 27-Jul-2006 18:20:34   

WayneBrantley wrote:

Would be nice if when I added files to a project in VS2005, I could make them dependent nodes to an existing file or vice versa...

That is really what I was after - If I have 50 entities in the 'EntityClasses' folder, I then make partial classes for half of them - now there are 75 files in this folder....

I just changed the system to generate the entities to a Gen folder which is a sub folder of EnityClasses with the file name templated of entityname.gen.cs and then I added a template to create another the partial class file as enityname.cs in the EntityClasses folder.

Would it be "nice" if the were grouped together like ASP.Net does, yes. Is it needed, no. We generally don't open/look at the genned version of the class unless we are possible debugging.

BOb

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 02-Aug-2006 01:06:02   

I wrote a task performer that inspects a project after its been generated/modified and will make any file with the .generated.cs ending dependant.

Not polished by any means, i hacked it together pretty quick, but works like a charm so far wink

i then just changed the default filename for entities to EntitynameEntity.generated.cs and added a another new task to generate the partial class..

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 02-Aug-2006 06:32:10   

That sounds nice. Want to share? Email it to support at llblgen dot com and they will put in 3rd party section.

I would like to try it out....

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 03-Aug-2006 20:32:34   

i can do that, but i really dont have time to make it purty for 3rd part generic use. If you would like to try it, post your email and ill email you the task performer and task..

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 03-Aug-2006 20:55:41   

Cool... send it to <edit> Received! </edit>

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 04-Aug-2006 20:04:12   

SENT